hosting

PUT /v1/sites/{siteId}/cms-target

Tell us where this site's posts should go.

所有 hosting 端点

所有开发者文档

身份验证

请将 API 密钥作为 bearer 令牌发送。此端点在规范中未指明具体的权限,因此请为您的密钥赋予所需的最小权限,并通过检查响应来确认,而不是盲目假设。

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

免费试用

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

curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/cms-target \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "kind": <string<wordpress, headless_rest, git_static>> }'

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

详细信息

Creates or replaces the site's content target. Gated on links.edit. ⛔ secret is write-only, and omitting it keeps the credential you already have rather than clearing it — a customer editing a collection name must not silently delete their key. The secret is written to Vault before the row is saved, and the row is only written if that succeeded: the other order leaves a row that reads as configured on every screen and fails at the first publish.

参数

名称类型必填内容简介
siteId (path)string

请求正文

名称类型必填内容简介
kindstring<wordpress, headless_rest, git_static>
presetstring<, payload, strapi, directus, ghost, shopify, webflow, custom>
base_urlstring
collectionstring
auth_schemestring<, bearer, payload_api_key, ghost_admin_jwt, shopify_token, header>
auth_headerstring
field_mapobject
enabledboolean
secretstringThe API key. ⛔ Write-only, and omitting it keeps the credential you already have rather than clearing it. It is written to Vault before the row is saved, and the row is only…

响应

名称类型必填内容简介
site_idstring
kindstring<, wordpress, headless_rest, git_static>Empty when nothing claims this site. For a site with no configured row this is the derived target — most WordPress sites on our own fleet need no configuration at all, because…
presetstring<, payload, strapi, directus, ghost, shopify, webflow, custom>
base_urlstringThe CMS's API root. Empty for a target whose address is derived from the site (fleet WordPress, a connected Git repository).
collectionstringThe collection posts are created in — posts on Payload, a blog id on Shopify, a collection id on Webflow, the content directory on a Git target.
auth_schemestring<, bearer, payload_api_key, ghost_admin_jwt, shopify_token, header>
auth_headerstringFor the header auth scheme — which header the key is sent in.
field_mapobjectRenames, for a destination that spells our fields differently. ⛔ It renames; it never adds a capability. A field map cannot make a target able to carry a tag it has no field…
enabledbooleanA disabled target is skipped and reads as needs_setup — kept rather than deleted so pausing publishing to a site does not lose its set-up.
has_credentialboolean
capabilitiesstring[]
detected_identitystringWhat the destination said it was, last time it answered.
last_probe_atstring
last_probe_reachablebooleannull means never probed; false means probed and could not be reached. Those are different facts and a client must not render them the same.
last_probe_codestring
last_probe_detailstring

此端点可能返回的错误

401 · 403 · 404 · 422