Restore a web hosting backup
POST /api/v2/shared-hosting/{accountId}/backups/{snapshotId}/actions/restore
Restore a whole web hosting account from a backup. The account’s website files, databases and email are replaced by the contents of the restore point. To restore one database only, use POST /api/v2/shared-hosting/{accountId}/backups/databases/{backupId}/actions/restore. Check actions.canRestore on GET /api/v2/shared-hosting/{accountId}/backups first. The account must be active and on cPanel. The restore point must still be in the account’s backup list. Send no body or {}. The call answers 202 with a job (Jobs). 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_…).snapshotIdstringrequiredbkp_…) from GET /api/v2/shared-hosting/{accountId}/backups.Example
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/backups/before-upgrade/actions/restore" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json"Responses
202 Restore queued.
{ "operation": { "status": "queued", "jobId": "job_01hxa3b4c5d6e7f8g9h0j1k2m3", "pollUrl": "/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/backups/queue/job_01hxa3b4c5d6e7f8g9h0j1k2m3" }}Response fields
operationobjectstatusstringqueued. One of queued.jobIdstringjob_…).pollUrlstringErrors
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 restore point is not on this account or is no longer in its backup list (backup_not_found). List the backups again. |
| 409 | 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. |