Get a Database's Backup Schedule

GET /v1/databases/{uuid}/backup-schedule

A database's automatic backups (the dashboard's Automatic backups card on its Backups tab). A schedule takes one backup of the database daily or weekly at a fixed hour (UTC) and keeps the newest retain_count. Requires Databases read.

Response (200 OK)

schedule object | null
null when the database has never had one; otherwise the schedule object below.
retention_max int
The plan's backup_retention_max, the highest retain_count you can set. 0 when the plan sets none.

Schedule object

database_uuid string (uuid)
The database.
kind string
Always database.
enabled bool
Whether automatic backups are on.
frequency string
daily or weekly (every 7 days from the first run).
hour_utc int
The hour it runs, 0–23 UTC (on the hour).
retain_count int
How many backups to keep (see below).
last_run_at, next_run_at string
The last and the next run. next_run_at is absent while the schedule is off.
created_at, updated_at string
When the schedule was first saved and last changed.

Retention. Each scheduled run deletes the database's oldest completed backups beyond the newest retain_count, on-demand backups included. Whatever the schedule, ngris keeps at most 50 completed backups of a database: after each backup, older ones beyond the newest 50 are deleted.

When a run is skipped. A scheduled run takes no backup while the database isn't ready, is paused over the plan's database limit, already has a backup running, or the account is suspended; the schedule still moves on to its next run.

Errors

403
No Databases read, no active account, or no managed databases on the plan.
404
database not found.
503
database_backups_unavailable or databases_unavailable.
Request
curl "https://api.ngris.com/v1/databases/019c2a41-7d3e-7b52-a1c4-5e9f0b3d6a18/backup-schedule" \ -H "X-API-KEY: <your_api_key>"
Response — 200 OK
{ "schedule": { "database_uuid": "019c2a41-7d3e-7b52-a1c4-5e9f0b3d6a18", "kind": "database", "enabled": true, "frequency": "daily", "hour_utc": 3, "retain_count": 7, "last_run_at": "2026-10-19T03:00:00Z", "next_run_at": "2026-10-20T03:00:00Z", "created_at": "2026-10-18T09:30:00Z", "updated_at": "2026-10-19T03:00:00Z" }, "retention_max": 7 }

Set a Database's Backup Schedule

PUT /v1/databases/{uuid}/backup-schedule

Create or replace the database's schedule. The first run is the next hour_utc:00 UTC: today if that hour is still ahead, otherwise tomorrow (daily) or in 7 days (weekly). Requires Databases update.

Turning it on needs the plan's application_db_backup and application_backup_schedule, and is refused while the database is paused over the plan's database limit. Turning it off (enabled: false) needs neither entitlement and works on a paused database. If the account loses application_backup_schedule, ngris turns its databases' schedules off; turn them back on after upgrading.

Request body (application/json)

enabled bool
On or off. Omitted means false.
frequency string
daily (the default) or weekly.
hour_utc int
The hour to run, 0–23 UTC. Values outside are clamped; omitted means 0.
retain_count int
How many backups to keep. At least 1 (omitted or lower becomes 1), and lowered to the plan's backup_retention_max when it sets one.

Response (200 OK)

{"schedule": {…}}: the saved schedule, with the clamped values and the computed next_run_at.

Errors

400
invalid request body, or frequency must be 'daily' or 'weekly'.
403
Only when turning it on: Database backup is not available on your plan. or Scheduled backups are not available on your plan. Also: no Databases update, no active account, or no managed databases on the plan.
404
database not found.
409
quota_paused: turning it on while the database is paused over your plan's database limit.
database_status: Not possible while the database is deleting.
503
database_backups_unavailable or databases_unavailable.
Request
curl -X PUT \ "https://api.ngris.com/v1/databases/019c2a41-7d3e-7b52-a1c4-5e9f0b3d6a18/backup-schedule" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{ "enabled": true, "frequency": "daily", "hour_utc": 3, "retain_count": 7 }'
Response — 200 OK
{ "schedule": { "database_uuid": "019c2a41-7d3e-7b52-a1c4-5e9f0b3d6a18", "kind": "database", "enabled": true, "frequency": "daily", "hour_utc": 3, "retain_count": 7, "next_run_at": "2026-10-20T03:00:00Z", "created_at": "2026-10-19T10:20:00Z", "updated_at": "2026-10-19T10:20:00Z" } }
Request — turn it off
curl -X PUT \ "https://api.ngris.com/v1/databases/019c2a41-7d3e-7b52-a1c4-5e9f0b3d6a18/backup-schedule" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"enabled": false}'