hosting
POST /v1/sites/{siteId}/rename-domain
Change a site's primary domain (asynchronous).
Authentication
Send an API key as a bearer token. The key must carry the sites.create 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}/rename-domain \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "new_domain": <Hostname> }'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
Starts the durable **rename-domain** saga for a site (new-side setup → flip → old-side teardown, register #91). Returns `202 Accepted` immediately — the work runs as a Temporal workflow; poll the site or subscribe to `site.*` events for completion. Requires `sites.create` (the same authority that provisions a site). Idempotent on the site: a repeat call while the saga is running is accepted and does not start a second run.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
siteId (path) | Uuid | Yes | Site ID (UUIDv7). |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
new_domain | Hostname | Yes | The site's new primary domain (FQDN). |
keep_old_as_alias | boolean | No | Keep serving the old domain as an alias of the site after the flip. |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
site_id | Uuid | Yes | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
new_domain | Hostname | Yes | A fully-qualified DNS hostname, lowercase, no trailing dot. |
workflow_id | string | Yes | The Temporal workflow id running the rename saga (deterministic per site). |
status | string<accepted> | Yes | The saga was accepted; poll the site / `site.*` events for completion. |
Errors this endpoint can return
401 · 403 · 404 · 409 · 422 · 429 · 503