hosting

POST /v1/sites/{siteId}/rename-domain

Change a site's primary domain (asynchronous).

All hosting endpoints

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

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

Request body

NameTypeRequiredWhat it is
new_domainHostnameYesThe site's new primary domain (FQDN).
keep_old_as_aliasbooleanNoKeep serving the old domain as an alias of the site after the flip.

Response

NameTypeRequiredWhat it is
site_idUuidYesUUIDv7 identifier — sortable by creation time (docs/02 §8).
new_domainHostnameYesA fully-qualified DNS hostname, lowercase, no trailing dot.
workflow_idstringYesThe Temporal workflow id running the rename saga (deterministic per site).
statusstring<accepted>YesThe saga was accepted; poll the site / `site.*` events for completion.

Errors this endpoint can return

401 · 403 · 404 · 409 · 422 · 429 · 503