Checks the admin login from the cluster, makes a backup user with it, then saves the database and its schedule. Team owners and admins.
API key access: deploy.
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/jsonA database to back up.
teamId*stringname*stringA name for it, unique in the team.
engine*string"postgres", "mysql", "mariadb", "mongo" or "redis".
clusterId*stringThe cluster that reaches it and runs its backups.
serviceId?|The Pyo service it is, if it is one.
host*stringport*integerint320 <= valuedatabase?stringThe database to back up. Not needed for Redis.
adminUser*stringA login allowed to create users: Pyo makes a backup user with it and doesn't keep it.
adminPassword*stringenabled*booleanschedule*string"daily" or "weekly".
hour*integerThe hour of day it runs, 0 to 23 (UTC).
int320 <= valuekeep*integerHow many backups to keep, 1 to 365.
int320 <= valueSaved: ok and the new database's id.
application/jsoncurl -X POST 'https://your-pyo.example.com/api/v1/database-backups' \
-H 'Content-Type: application/json' \
-d '{
"teamId": "string",
"name": "string",
"engine": "string",
"clusterId": "string",
"host": "string",
"port": 0,
"adminUser": "string",
"adminPassword": "string",
"enabled": true,
"schedule": "string",
"hour": 0,
"keep": 0
}'{}