hosting

POST /v1/sites/{siteId}/origin-key/rotate

Rotate a site's origin-lock key, with no downtime.

All hosting endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

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

NameTypeRequiredWhat it is
siteId (path)UuidYesSite ID (UUIDv7).

Response

NameTypeRequiredWhat it is
site_idstringYes—
generationintegerYesHow many rotations have finished. 0 is the key the site was created with.
statestring<idle, staged, overlap, failed>Yesstaged - 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…
rotatingbooleanYesTrue while state is staged or overlap.
rotated_atobjectYesWhen the platform last switched to a new key.
previous_valid_untilobjectYesDuring overlap, when the old key stops being accepted.
last_errorstringYesWhy the last rotation failed, or empty.

Errors this endpoint can return

401 · 403 · 404 · 409 · 429