hosting
PUT /v1/sites/{siteId}/cdn/firewall-rules
Replace a site's custom edge firewall rules.
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/firewall-rules \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "rules": <object[]> }'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 rule set and the provider is made to match it exactly, including removing what is gone. A client must send back every rule it was shown — `foreign` ones included — because sending a subset deletes the rest. **Order is the security property, not presentation.** Cloudflare's custom-rules phase is terminating: the first matching rule decides and no later rule runs, so reordering the list changes which rule wins. Requires `hosting.cdn.manage`. A provider without custom rules is a `422` with code `UNSUPPORTED_BY_PROVIDER`.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
siteId (path) | Uuid | Yes | Site ID (UUIDv7). |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
rules | object[] | Yes | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
supported | boolean | Yes | — |
rules | CdnFirewallRule[] | Yes | In evaluation order. The provider's custom-rules phase is terminating — the first match decides. |
Errors this endpoint can return
401 · 403 · 404 · 422 · 429 · 503