hosting
GET /v1/sites/{siteId}/database
Get a site's database size and panel links.
身份验证
请将 API 密钥作为 bearer 令牌发送。此端点在规范中未指明具体的权限,因此请为您的密钥赋予所需的最小权限,并通过检查响应来确认,而不是盲目假设。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X GET https://api.zinndigital.com/v1/sites/{siteId}/database \
-H "Authorization: Bearer zdk_live_…"已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
The per-site Tools tab's Database card — the site's MySQL size and table count, plus single-use SSO links into the phpMyAdmin and File Manager panels. Requires both sites.view and sites.panel_access — the panels are full database and filesystem access, which is strictly more than listing a site — and is RLS-scoped to a site the caller holds sites.panel_access over, so holding the key in one org never reaches another org's site. An out-of-scope or unknown id is a 404, exactly like getSite; a caller who can see the site but lacks sites.panel_access gets a 403. The data source is provisioned, not synchronous. The size/table figures come from the site's fleet worker and the panels are stood up per host behind Cloudflare Access. Until a host is serving them, available is false and every figure and panel URL is null — never a fabricated 0 or a link to a panel that is not there. The shape is stable, so populating it later is not a contract change. Panel URLs, when present, are always HTTPS single-use links minted on read (a non-HTTPS panel URL is never returned).
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
siteId (path) | Uuid | 是 | Site ID (UUIDv7). |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
available | boolean | 是 | Whether a host is serving this site's database + panels yet. |
reason | string | 否 | Why a link or a figure is missing, in words a customer can act on. available: false alone cannot distinguish "this site has no server yet" from "we could not reach the box" from… |
reason_code | string | 否 | A stable, machine-readable name for the reason above — the half a CLIENT should render. reason is English prose for staff, SDK consumers and support tickets; this platform ships… |
size_mb | object | 是 | Total database size in MB; null when unavailable. |
tables | object | 是 | Number of tables in the database; null when unavailable. |
phpmyadmin_sso_url | object | 是 | HTTPS single-use SSO link into phpMyAdmin, minted on read; null when the panel is not provisioned. Never a non-HTTPS URL. |
filemanager_sso_url | object | 是 | HTTPS single-use SSO link into the File Manager, minted on read; null when the panel is not provisioned. Never a non-HTTPS URL. |
web_ide_sso_url | object | 是 | HTTPS single-use SSO link into the Web IDE — real VS Code (code-server) running in the browser against this site's files. Minted on read; null when the site is not on one of our… |
此端点可能返回的错误
401 · 403 · 404 · 429