hosting
PUT /v1/sites/{siteId}/cdn/firewall-rules
Replace a site's custom edge firewall rules.
Autenticação
Envie uma chave de API como um token de portador. A chave deve ter a permissão hosting.cdn.manage; uma chave sem ela é recusada com 403, e não 404.
Este endpoint não requer um ID de organização. Sua chave já identifica a organização à qual pertence, e a resposta é delimitada a ela.
Experimente
Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.
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[]> }'Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API
Detalhes
**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`.
Parâmetros
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
siteId (path) | Uuid | Sim | Site ID (UUIDv7). |
Corpo da requisição
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
rules | object[] | Sim | — |
Resposta
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
supported | boolean | Sim | — |
rules | CdnFirewallRule[] | Sim | In evaluation order. The provider's custom-rules phase is terminating — the first match decides. |
Erros que este endpoint pode retornar
401 · 403 · 404 · 422 · 429 · 503