hosting
PUT /v1/sites/{siteId}/cdn/header-rules
Replace a site's own edge response headers.
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/header-rules \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "rules": <CdnHeaderRule[]> }'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) and sets one response header to value, or removes it when value is empty. Our managed headers always win: every customer rule runs before ours, and for the same header name the later rule's value is the one sent. A name in protected_headers or starting cf- is a 422 (refusal.edge.headerProtected; HSTS has its own setting on the certificate card), a malformed name or value is a 422 (refusal.edge.headerNameInvalid, refusal.edge.headerValueInvalid), more rules than max_rules is a 422 (refusal.edge.headerRulesTooMany) and a shared zone is a 422 (refusal.edge.headerRulesSharedZone). Requires hosting.cdn.manage; audited as site.cdn.header_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 | CdnHeaderRule[] | Yes | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
site_id | string | Yes | — |
supported | boolean | Yes | — |
rules | CdnHeaderRule[] | Yes | — |
max_rules | integer | Yes | How many rules this site may have, its current ones included. |
protected_headers | string[] | Yes | Header names no rule may set or remove (lower-case); cf-* too. |
Errors this endpoint can return
401 · 403 · 404 · 422 · 429 · 502 · 503