hosting
PUT /v1/sites/{siteId}/cdn/redirect-rules
Replace a site's own edge redirects.
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
| Name | Type | Required | What it is |
|---|---|---|---|
siteId (path) | Uuid | Yes | Site ID (UUIDv7). |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
rules | CdnRedirectRule[] | Yes | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
site_id | string | Yes | — |
supported | boolean | Yes | — |
rules | CdnRedirectRule[] | Yes | — |
max_rules | integer | Yes | How many redirects this site may have, its current ones included. |
Errors this endpoint can return
401 · 403 · 404 · 422 · 429 · 502 · 503