Skip to main content

Backup Policy

Configure automated backup schedules for your databases.

Get Backup Policy

GET /v1/databases/{db_type}/{db_name}/backup-policy
curl -X GET "https://api.wayscloud.services/v1/databases/postgresql/my_db/backup-policy" \
-H "Authorization: Bearer $WAYSCLOUD_API_KEY"

Set Backup Policy

PUT /v1/databases/{db_type}/{db_name}/backup-policy
{
"enabled": true,
"schedule": "daily",
"retention_days": 30,
"time": "02:00"
}

Parameters

  • enabled - Enable/disable automated backups
  • schedule - hourly, daily, weekly
  • retention_days - How long to keep backups (1-365)
  • time - Backup time (HH:MM format, UTC)

Example

curl -X PUT "https://api.wayscloud.services/v1/databases/postgresql/my_db/backup-policy" \
-H "Authorization: Bearer $WAYSCLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"schedule": "daily",
"retention_days": 30,
"time": "02:00"
}'

Response

{
"success": true,
"backup_policy": {
"enabled": true,
"schedule": "daily",
"retention_days": 30,
"time": "02:00",
"next_backup": "2025-11-05T02:00:00Z"
}
}

Best Practices

  1. Daily backups for production databases
  2. 30-day retention minimum
  3. Off-peak hours for backup time
  4. Test restores regularly