Restore a database backup
POST /api/v2/shared-hosting/{accountId}/backups/databases/{backupId}/actions/restore
Restore one database on a web hosting account from a backup. The database is replaced by its state in the backup. Website files, email, DNS and the account’s other databases are not touched. Check actions.canRestore on the backup in GET /api/v2/shared-hosting/{accountId}/backups/databases first. A damaged or unavailable backup answers 409 backup_not_restorable. The account must be active and on cPanel. Send no body or {}. The call answers 202 with a job (Jobs) and the database’s name. GET /api/jobs/{jobId} answers 404 for this ID. Poll operation.pollUrl instead. It points to GET /api/v2/shared-hosting/{accountId}/backups/queue/{queueRef}, which answers status and progressPercent at the top level.
Authentication: An API key with the scopes write:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).backupIdstringrequiredbkp_…) from GET /api/v2/shared-hosting/{accountId}/backups/databases.Example
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/backups/databases/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/restore" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json"Responses
202 Database restore queued.
{ "operation": { "status": "queued", "jobId": "job_01hxa3b4c5d6e7f8g9h0j1k2m3", "pollUrl": "/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/backups/queue/job_01hxa3b4c5d6e7f8g9h0j1k2m3" }, "database": { "name": "abcde_wp" }}Response fields
operationobjectstatusstringqueued. One of queued.jobIdstringjob_…).pollUrlstringdatabaseobjectnamestringErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | The database backup is not on this account or is no longer in its list (backup_not_found). List the database backups again. |
| 409 | The backup is damaged or not available for restore (backup_not_restorable). Also returned when the account is on Hostup’s previous hosting platform (account_not_eligible_cpanel). |
| 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. |