身份验证
请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 sites.view 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X GET https://api.zinndigital.com/v1/sites/{siteId}/ssh-keys \
-H "Authorization: Bearer zdk_live_…"已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
Every public key that can open a shell on the site's hosting package, together with whether the package restricts SSH to a list of addresses. `ssh` has been rendered as an included plan feature since the Hosting tab shipped — from a vendor flag that really is `true` on both package types we sell — with no way anywhere in the product to upload a key, so until this resource existed the entitlement was sold and read by nothing. ⛔ `ip_restricted` is its own field and must never be derived from `ip_allowlist == []`. The vendor answers "no restriction" as null, and an empty list rendered as a restriction would tell the customer they are protected when the truth is the opposite. `ip_allowlist_editable` is false today for a **vendor** reason rather than a plan one, so a client renders the list read-only instead of an editor that cannot save. A site that is not on a vendor hosting package has no such resource and returns `404`, exactly as an out-of-scope or unknown id does — never a `403`, never an existence oracle. Requires `sites.view` **and** `sites.panel_access`: the list is the access-control state of a shell on the customer's server, which is strictly more than the phpMyAdmin and file-manager access that key already names.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
siteId (path) | Uuid | 是 | Site ID (UUIDv7). |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
permitted | boolean | 是 | Whether the package type includes SSH at all. This is the flag behind *"your plan does not include this"*. |
can_create | boolean | 是 | `permitted`, **and** the package has room for another key. Two fields rather than one because those are different sentences, and a single flag makes the screen say the wrong one. |
keys | SiteSshKey[] | 是 | The keys currently authorised on the package. |
ip_allowlist | string[] | 是 | The addresses SSH is restricted to, when it is restricted. |
ip_restricted | boolean | 是 | Whether an address restriction is actually in force. ⛔ **Distinct from `ip_allowlist == []` and never derived from it.** The vendor answers "no restriction" as null, and an empt… |
ip_allowlist_editable | boolean | 是 | Whether the allow-list can be written. False today for a **vendor** reason rather than a plan one, so a client renders the list read-only instead of an editor that cannot save. |
此端点可能返回的错误
401 · 403 · 404 · 422 · 429 · 503