hosting

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

Replace a site's own edge cache rules.

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/cache-rules \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "rules": <CdnCacheRule[]> }'

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 either never caches it (cache: false) or caches it, for the chosen edge and browser lifetimes when set (null follows the origin's own headers). A customer rule can never cache a signed-in, cart or admin page: every rule is placed before our login, cart and admin bypasses, which stay the later and winning match. More rules than max_rules is a 422 (refusal.edge.cacheRulesTooMany); a shared zone is a 422 (refusal.edge.cacheRulesSharedZone). Requires hosting.cdn.manage; audited as site.cdn.cache_rules_updated.

Parameters

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

Request body

NameTypeRequiredWhat it is
rulesCdnCacheRule[]Yes—

Response

NameTypeRequiredWhat it is
site_idstringYes—
supportedbooleanYes—
rulesCdnCacheRule[]Yes—
max_rulesintegerYesHow many rules this site may have, its current ones included.
ttl_choicesinteger[]YesThe lifetimes, in seconds, a rule may choose.

Errors this endpoint can return

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