Docs/Guides/Backups & restore
Backups & restore
On-demand backups
curl -X POST .../databases/$DATABASE_ID/backups -H "Authorization: Bearer $TOKEN"
# 202 Accepted, returns a job_id — same async pattern as everything else.
curl .../databases/$DATABASE_ID/backups -H "Authorization: Bearer $TOKEN" # list
curl .../databases/$DATABASE_ID/backups/$BACKUP_ID -H "Authorization: Bearer $TOKEN" # detail
Restoring
A restore creates a new database from a backup — it never overwrites the original:
curl -X POST .../databases/$DATABASE_ID/backups/$BACKUP_ID/restore \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "production-restored"}'
# 202 Accepted — poll the job, then the new database appears in the project's list.
Backup policy
Each database has an automatic backup policy, readable and configurable:
curl .../databases/$DATABASE_ID/backup-policy -H "Authorization: Bearer $TOKEN"
curl -X PUT .../databases/$DATABASE_ID/backup-policy \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": true, "frequency_hours": 24, "retention_days": 7}'
| Field | Default | Range |
|---|---|---|
enabled | true | — |
frequency_hours | 24 | 1 – 720 |
retention_days | 7 | 1 – 365 |
Backups older than retention_days are cleaned up automatically.
Was this page helpful?