Turn a database's backups on or off, to the team's Backups destination. Postgres: every change archived continuously and a base backup daily, so it can be restored to any moment in the last retentionDays. MySQL: a full backup daily with the changes since the last one, so it can be restored to any moment in the last retentionDays up to its latest backup. Both are stored in the team's folder of the destination. KV: a snapshot scheduled daily or weekly, the last keep kept, listed in Backups with the team's other databases. Developers and up.
API key access: full.
apiKeyAuthorizationBearer <pyo_…>An API key from the dashboard's API keys page: Authorization: Bearer pyo_…. Keys can expire, and an expired one gets a 401.
application/jsonTurn a database's backups on or off, to the team's Backups destination. Postgres: every change archived continuously and a base backup daily, so it can be restored to any moment in the last retentionDays. MySQL: a full backup daily with the changes since the last one, so it can be restored to any moment in the last retentionDays up to its latest backup. Both are stored in the team's folder of the destination. KV: a snapshot scheduled daily or weekly, the last keep kept, listed in Backups with the team's other databases. Developers and up.
API key access: full.
op*"setDatabaseBackups""setDatabaseBackups"id*stringenabled*booleanretentionDays?|Postgres and MySQL: 1 to 90, 7 by default.
int320 <= valuehour?|The hour backups run, 0 to 23 (UTC). Defaults to 3 for Postgres and MySQL, and 2 for KV.
int320 <= valueschedule?|KV: "daily" (default) or "weekly".
keep?|KV: how many snapshots to keep, 1 to 365, 14 by default.
int320 <= valueDone. Always ok: true, and some operations add more, such as a new API key or a join command. A warning comes with a change that went through but won't fully take effect yet, such as more replicas than the servers have room for.
application/jsoncurl -X POST 'https://your-pyo.example.com/api/v1/ops' \
-H 'Content-Type: application/json' \
-d '{
"enabled": true,
"id": "mdb_8kq2x7ad",
"op": "setDatabaseBackups"
}'{}