Get a Database's 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)
null when the database has never had one; otherwise the schedule object below.backup_retention_max, the highest retain_count you can set. 0 when the plan sets none.Schedule object
database.daily or weekly (every 7 days from the first run).0–23 UTC (on the hour).next_run_at is absent while the schedule is off.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
database not found.database_backups_unavailable or databases_unavailable.Set a Database's 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)
false.daily (the default) or weekly.0–23 UTC. Values outside are clamped; omitted means 0.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
invalid request body, or frequency must be 'daily' or 'weekly'.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.database not found.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.
database_backups_unavailable or databases_unavailable.