Skip to content

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

accountIdstringrequired
The web hosting account ID (acct_…).
snapshotIdstringrequired
The restore point ID (bkp_…) from GET /api/v2/shared-hosting/{accountId}/backups.

Example

POST /api/v2/shared-hosting/{accountId}/backups/{snapshotId}/actions/restore
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.

Response 202
{
"operation": {
"status": "queued",
"jobId": "job_01hxa3b4c5d6e7f8g9h0j1k2m3",
"pollUrl": "/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/backups/queue/job_01hxa3b4c5d6e7f8g9h0j1k2m3"
}
}
Response fields
operationobject
statusstring
Always queued. One of queued.
jobIdstring
The restore job (job_…).
pollUrlstring
Path that reports the restore’s progress.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404The restore point is not on this account or is no longer in its backup list (backup_not_found). List the backups again.
409The account is on Hostup’s previous hosting platform (account_not_eligible_cpanel).
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
502Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists.