Set a VPS backup schedule
POST /api/v2/vps/{id}/backup-schedules
Creates the backup schedule of a VPS. A VPS can have one schedule. Sending the same frequency again replaces it. To switch to another frequency, delete the current schedule first. Check actions.canCreate and limits on GET /api/v2/vps/{id}/backup-schedules before you call. hour is in Europe/Stockholm time. The server picks the minute. retentionCount cannot be higher than limits.maxRetention. Plans without backups return 409 product_not_orderable. Backups are offsite, longer-term copies and can take longer to create and restore than snapshots. For a quick rollback point, use POST /api/v2/vps/{id}/snapshot-schedules instead.
Authentication: An API key with the scope write:vm. About keys and scopes
Request
Path parameters
idstringrequiredvps_…).Body
frequencystringrequireddaily, weekly or monthly. One of daily, weekly, monthly.hourintegerrequireddayOfWeekintegerweekly and not allowed for other frequencies. 0 to 6.dayOfMonthintegermonthly and not allowed for other frequencies. 1 to 31.retentionCountintegerrequiredlimits.maxRetention. Each run keeps at most this many scheduled backups. It never keeps more than limits.availableScheduledSlots. At least 1.enabledbooleanrequirednamestringBackup schedule. GET /api/v2/vps/{id}/backup-schedules calls it daily backup, weekly backup or monthly backup. Send a name to get the same label in both.Example
curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/backup-schedules" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "frequency": "daily", "hour": 2, "retentionCount": 3, "enabled": true, "name": "Nightly backup" }'curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/backup-schedules" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "frequency": "weekly", "hour": 3, "dayOfWeek": 0, "retentionCount": 4, "enabled": true }'Responses
201 The saved schedule.
{ "id": "bks_01hxa3b4c5d6e7f8g9h0j1k2m3", "name": "Nightly backup", "frequency": "daily", "time": "02:17", "daySpecifier": null, "retentionCount": 3, "enabled": true, "lastRun": null, "nextRun": "2026-04-28T00:17:00.000Z", "status": null, "lastRunStatus": null, "lastRunAt": null}Response fields
idstringbks_…).namestringfrequencystringdaily, weekly or monthly. One of daily, weekly, monthly.timestring or nullHH:MM in Europe/Stockholm time.daySpecifierstring or nullweekly. Day of the month for monthly. Null for daily.retentionCountintegerenabledbooleanlastRunstring or nullnextRunstring or nullstatusstring or nulllastRunStatus for the result of its last backup. One of completed, running, queued, failed, cancelled, unknown.lastRunStatusstring or nullcompleted, failed or queued. Null when it has not run yet. One of completed, running, queued, failed, cancelled, unknown.lastRunAtstring or nullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | The body is invalid. A field that breaks the rules above returns one detail that lists the rules, without errors. A retentionCount above limits.maxRetention returns errors[0].pointer /retentionCount and errors[0].code retention_exceeds_backup_limit, plus limits. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is vps_not_found. |
| 409 | No schedule can be saved. Branch on code: backup_schedule_limit_reached (another schedule exists or no backup slot is free) or product_not_orderable (the plan has no backups). actions.canCreate and limits in the body say why. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |
| 502 | Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists. |