身份验证
请将 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 | 是 | — |
请求正文
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
kind | string<wordpress, headless_rest, git_static> | 是 | — |
preset | string<, payload, strapi, directus, ghost, shopify, webflow, custom> | 否 | — |
base_url | string | 否 | — |
collection | string | 否 | — |
auth_scheme | string<, bearer, payload_api_key, ghost_admin_jwt, shopify_token, header> | 否 | — |
auth_header | string | 否 | — |
field_map | object | 否 | — |
enabled | boolean | 否 | — |
secret | string | 否 | The 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_id | string | 是 | — |
kind | string<, 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, becau… |
preset | string<, payload, strapi, directus, ghost, shopify, webflow, custom> | 是 | — |
base_url | string | 是 | The CMS's API root. Empty for a target whose address is derived from the site (fleet WordPress, a connected Git repository). |
collection | string | 是 | The 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_scheme | string<, bearer, payload_api_key, ghost_admin_jwt, shopify_token, header> | 是 | — |
auth_header | string | 是 | For the `header` auth scheme — which header the key is sent in. |
field_map | object | 是 | Renames, 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… |
enabled | boolean | 是 | A 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_credential | boolean | 是 | — |
capabilities | string[] | 是 | — |
detected_identity | string | 是 | What the destination said it was, last time it answered. |
last_probe_at | string | 是 | — |
last_probe_reachable | boolean | 是 | ⛔ `null` 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_code | string | 是 | — |
last_probe_detail | string | 是 | — |
此端点可能返回的错误
401 · 403 · 404 · 422