hosting
POST /v1/sites/{siteId}/origin-key/rotate
Rotate a site's origin-lock key, with no downtime.
Authentication
Send an API key as a bearer token. The key must carry the sites.view permission; a key without it is refused with 403, not 404.
This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/origin-key/rotate \
-H "Authorization: Bearer zdk_live_…"Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
Replaces this ONE site's origin-lock key; no other site's key changes. Runs as a background job: the server is taught the new key alongside the old one and proven to accept it, the platform switches to the new key, and after a 15-minute grace window the old key is removed and proven refused. The site keeps serving throughout. Audit-logged. Answers 202 with state: staged. 409 while a rotation is already running. 404 for a site that is not the caller's or is not on one of our servers. Requires sites.view and sites.panel_access.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
siteId (path) | Uuid | Yes | Site ID (UUIDv7). |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
site_id | string | Yes | — |
generation | integer | Yes | How many rotations have finished. 0 is the key the site was created with. |
state | string<idle, staged, overlap, failed> | Yes | staged - the server is learning the new key; overlap - the platform sends the new key and the old one is still accepted until previous_valid_until; failed - the last… |
rotating | boolean | Yes | True while state is staged or overlap. |
rotated_at | object | Yes | When the platform last switched to a new key. |
previous_valid_until | object | Yes | During overlap, when the old key stops being accepted. |
last_error | string | Yes | Why the last rotation failed, or empty. |
Errors this endpoint can return
401 · 403 · 404 · 409 · 429