hosting
POST /v1/sites/{siteId}/backups/restore
Restore a site from one of its backups.
Uthibitishaji
Tuma ufunguo wa API kama tokeni ya kubeba. Ufunguo lazima uwe na ruhusa ya hosting.backup.manage; ufunguo usio nayo unakataliwa kwa 403, si 404.
Endpoint hii haichukui kitambulisho cha shirika. Ufunguo wako tayari unalitambua shirika linalohusika, na jibu limewekewa kikomo kwa shirika hilo pekee.
Jaribu
Badilisha chochote kilicho ndani ya mabano ya pembe na maadili yako mwenyewe, na kishikiliaji cha ufunguo na ufunguo kutoka kwa dashibodi yako.
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/backups/restore \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "backup_id": <Uuid> }'Umeingia kwenye akaunti? Dashibodi yako ya kiweko cha API inajaza kitambulisho chako halisi cha shirika na ufunguo wako mwenyewe, na kuendesha ombi dhidi ya API ya moja kwa moja ili uweze kuona jibu halisi. Fungua sehemu hii ya mwisho (endpoint) kwenye konsole ya API
Maelezo
⛔ **Destructive.** This overwrites the site's live database and files with the contents of the named backup. Its own path rather than a verb on the collection, so it can never be reached by varying the body of the endpoint that *takes* backups. The backup must belong to this site and must have completed successfully; anything else is 422. Requires `hosting.backup.manage`.
Vigezo
| Jina | Aina | Inayohitajika | Kilicho hiki |
|---|---|---|---|
siteId (path) | Uuid | Ndiyo | Site ID (UUIDv7). |
Idempotency-Key (header) | string | Hapana | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Mwili wa ombi
| Jina | Aina | Inayohitajika | Kilicho hiki |
|---|---|---|---|
backup_id | Uuid | Ndiyo | The backup to restore. Always named explicitly — there is no "restore the latest", because a destructive operation must not depend on which row happens to sort first. |
Majibu
| Jina | Aina | Inayohitajika | Kilicho hiki |
|---|---|---|---|
site_id | Uuid | Ndiyo | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
backups | SiteBackup[] | Ndiyo | — |
can_backup | boolean | Ndiyo | False while a backup is in flight, when this site's hosting platform cannot take one at all, or when the site's on-demand allowance for the last 24 hours is spent. |
in_progress | boolean | Ndiyo | — |
on_demand_backups | boolean | Ndiyo | Always true. On-demand backups are included on every plan (owner ruling 2026-08-10); what bounds them is `on_demand_limit` per rolling 24 hours, not the plan. Retained for compa… |
unsupported_reason | string | Hapana | A stable machine identifier saying why this site's hosting platform cannot be backed up at all, or empty when it can. The client renders it as a localised sentence. Distinct fro… |
on_demand_limit | integer | Ndiyo | On-demand backups allowed per rolling 24 hours, per site. |
on_demand_used | integer | Ndiyo | On-demand backups taken in the last 24 hours. Failed attempts are not counted — the customer got nothing from them. |
on_demand_remaining | integer | Ndiyo | How many the customer may still take right now. |
on_demand_next_at | string | Ndiyo | When the next on-demand slot opens, as the oldest counted backup ages out of the rolling window. Null whenever `on_demand_remaining` is above zero. |
daily_backups | boolean | Ndiyo | The plan's `daily_backups` entitlement — whether the nightly sweep selects this site. |
retention_days | integer | Ndiyo | The plan's `backup_retention_days` entitlement, clamped to the platform maximum. |
offsite_enabled | boolean | Ndiyo | Whether object storage is configured. False means every backup stays on the worker host it was taken on. |
immutable | boolean | Ndiyo | Whether backup immutability is enforced **and proven recently**. True only when the platform's last reconciliation actually attempted to delete a canary object under the backup… |
immutable_days | integer | Ndiyo | How many days a written backup cannot be altered or deleted by anyone — us, a compromised site, or a stolen token. 30 by owner ruling (2026-08-12), matching sold retention; `0`… |
immutability_verified_at | string | Ndiyo | When a delete was last actually attempted against the protected prefix and refused. ⛔ Not when the configuration was last read, and not when the reconciler last ran: a run that… |
immutability_reason | string | Ndiyo | A stable machine identifier saying why immutability is not currently provable — `never_checked`, `no_rule`, `delete_succeeded`, `credential_missing`, `canary_write_failed`, `ven… |
restore_drill_passed | boolean | Ndiyo | Whether the platform's weekly restore drill last **passed**, and recently enough to still mean something. The drill restores a real stored backup onto a platform-owned site and… |
restore_drill_at | string | Ndiyo | When the last drill finished, whatever its outcome. Null when no drill has ever completed. |
restore_drill_reason | string | Ndiyo | A stable machine identifier saying why restores are not currently proven — `never_drilled`, `no_drill_site`, `no_recent_backup`, `canary_unavailable`, `restore_failed`, `fence_r… |
Hitilafu ambazo mwisho huu unaweza kurudisha
401 · 403 · 404 · 422 · 429 · 503