身份验证
请将 API 密钥作为 bearer 令牌发送。此端点在规范中未指明具体的权限,因此请为您的密钥赋予所需的最小权限,并通过检查响应来确认,而不是盲目假设。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X GET https://api.zinndigital.com/v1/sites/{siteId}/metrics \
-H "Authorization: Bearer zdk_live_…"已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
Point-in-time usage for the Overview panel — disk, bandwidth, visits, the PHP version, the TLS state, and a short daily bandwidth series for the usage chart. RLS-scoped to a site the caller can view (sites.view); an out-of-scope or unknown id is a 404, exactly like getSite. Collection is asynchronous. Metrics are gathered off the request path (a scheduled pull from the site's fleet worker into a cached store — never a live per-request driver call, CLAUDE.md §2.16) and read back here. Until a sample has been collected — a freshly-provisioned or suspended site, or a site on a worker not yet reporting — available is false, collected_at is null and the usage counters are null; the shape is stable so the client renders "usage not yet available" without a contract change once the collector populates it.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
siteId (path) | Uuid | 是 | Site ID (UUIDv7). |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
available | boolean | 是 | Whether a metrics sample has been collected for this site yet. |
disk_used_mb | object | 是 | Disk the site is using, in MB, from the newest stored hourly reading. null when nothing has measured it yet or when the newest reading is too old to present as current — the… |
disk_limit_mb | object | 是 | The disk ceiling ENFORCED on the box, in MB, as last stored. null when no ceiling is recorded. ⛔ Not the plan allowance — see getSiteQuota, which returns both separately… |
bandwidth_mb | object | 是 | Bandwidth used in the current period. |
visits | object | 是 | — |
php_version | string | 否 | The PHP version the site runs; empty when not applicable/unknown. |
serving_ok | object | 否 | Whether the site actually answered over HTTPS from outside the box at serving_checked_at, established by the recurring serving sweep rather than on this request. null… |
serving_checked_at | object | 否 | When a DEFINITE serving verdict was last obtained; null until one has been. Deliberately separate from the sweep's rotation cursor, which advances for every site the sweep… |
serving_detail | string | 否 | The short status line behind serving_ok — "HTTP 522", "ConnectTimeout". Never a raw vendor response body. |
ssl_status | string<active, pending, none, unknown> | 否 | The site's TLS certificate state. |
ssl_expires_at | object | 否 | — |
bandwidth_series | integer[] | 是 | Recent daily bandwidth samples (MB), oldest first — for the usage chart. Empty when unavailable. |
collected_at | object | 是 | When this sample was collected; null when unavailable. |
error_rate | SiteErrorRate | 是 | HTTP and PHP errors for one site over the newest closed collection window (#626). What features/uptime-monitoring sells:… |
此端点可能返回的错误
401 · 403 · 404 · 429