hosting

PUT /v1/sites/{siteId}/cdn/settings

Change a site's CDN zone settings.

所有 hosting 端点

所有开发者文档

身份验证

请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 hosting.cdn.manage 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。

此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。

免费试用

将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。

curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/cdn/settings \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点

详细信息

A merge: only the fields present in the body are changed and an absent field is left alone — never reset to a default. A client written before a setting existed must not switch it off on every save. The body carries settings and nothing else. additionalProperties: false is load-bearing rather than tidy: these are pooled CDN accounts holding other customers' zones and a Cloudflare zone resolves by name alone, so a body key named domain or zone_id must be refused rather than silently discarded. The hostname is always read off the site row. ssl_mode deliberately does not accept Cloudflare's flexible, which leaves the edge-to-origin leg in plaintext. An empty body is a 422, not a no-op success. A provider without these controls is a 422 with code UNSUPPORTED_BY_PROVIDER — a save that reported success having changed nothing would be worse than a refusal. Requires hosting.cdn.manage.

参数

名称类型必填内容简介
siteId (path)UuidSite ID (UUIDv7).

请求正文

名称类型必填内容简介
cache_levelCdnCacheLevelHow aggressively the edge treats query strings as distinct cached objects, least to most. Cloudflare's bypass is deliberately not offered: it is an emergency operator state, and…
development_modeboolean
always_onlineboolean
ssl_modeCdnSslModeThe TLS leg between the edge and the origin. Cloudflare's flexible is deliberately absent — it leaves that leg in plaintext, and the platform's Cloudflare adapter refuses to be…
brotliboolean

响应

名称类型必填内容简介
site_idUuidUUIDv7 identifier — sortable by creation time (docs/02 §8).
supportedbooleanWhether the CDN serving this site can express these settings at all. false for a pull-zone provider with no equivalent vocabulary; the other fields then carry defaults and a…
supported_valuesobjectFor an enumerated supported field, which values this provider can be set to. A field absent from this map takes every value in its own vocabulary — the common case, so the…
supported_fieldsstring[]Which of the five settings this site's CDN can actually express. ⛔ Sent always and empty rather than omitted when there are none — a client reading absence as "all of them"…
cache_levelCdnCacheLevelReportedWhat a provider may REPORT for cache_level — the writable vocabulary plus the read-only states. by_parameters means the edge caches by a named list of query parameters
development_modebooleanBypass the cache entirely so edits are visible immediately. The provider expires this automatically — see development_mode_seconds_remaining.
development_mode_seconds_remainingintegerSeconds until the provider switches development mode off again, as reported by the provider rather than derived from when we set it. 0 when it is off. It is a countdown and not…
always_onlinebooleanServe an archived copy of the page when the origin is unreachable.
ssl_modeCdnSslModeThe TLS leg between the edge and the origin. Cloudflare's flexible is deliberately absent — it leaves that leg in plaintext, and the platform's Cloudflare adapter refuses to be…
brotlibooleanServe Brotli-compressed responses to clients that accept them.

此端点可能返回的错误

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