hosting

PUT /v1/sites/{siteId}/cdn/redirect-rules

Replace a site's own edge redirects.

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 hosting.cdn.manage 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 PUT https://api.zinndigital.com/v1/sites/{siteId}/cdn/redirect-rules \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "rules": <CdnRedirectRule[]> }'

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

Convergent and whole-list. The body is the complete ordered list; an empty list removes them all. Each rule matches one page path (exact) or everything under it (prefix) on the site's own address and its www twin, and sends the visitor to target (a path on this site or a full http(s):// address) with status (301, 302, 307 or 308), keeping the query string when keep_query is true. Our canonical-host redirect always runs first. A target the rule itself matches on this site is a 422 (refusal.edge.redirectLoops), a target that is not a path or an http(s) address is a 422 (refusal.edge.redirectTargetInvalid), more rules than max_rules is a 422 (refusal.edge.redirectRulesTooMany) and a shared zone is a 422 (refusal.edge.redirectRulesSharedZone). Requires hosting.cdn.manage; audited as site.cdn.redirect_rules_updated.

Parameters

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

Request body

NameTypeRequiredWhat it is
rulesCdnRedirectRule[]Yes—

Response

NameTypeRequiredWhat it is
site_idstringYes—
supportedbooleanYes—
rulesCdnRedirectRule[]Yes—
max_rulesintegerYesHow many redirects this site may have, its current ones included.

Errors this endpoint can return

401 · 403 · 404 · 422 · 429 · 502 · 503