hosting

GET /v1/sites/{siteId}/metrics

Get a site's current usage metrics.

Tous les points de terminaison hosting

Toute la documentation pour développeurs

Authentification

Envoyez une clé d'API en tant que jeton du porteur (bearer token). Cet endpoint n'indique pas de permission spécifique dans la spécification, attribuez donc à votre clé le minimum requis et vérifiez la réponse plutôt que de faire des suppositions.

Cet endpoint ne prend aucun identifiant d'organisation. Votre clé identifie déjà l'organisation à laquelle elle appartient, et la réponse y est limitée.

Essayer

Remplacez tout ce qui se trouve entre crochets par vos propres valeurs, et le espace réservé à la clé par une clé de votre tableau de bord.

curl -X GET https://api.zinndigital.com/v1/sites/{siteId}/metrics \
  -H "Authorization: Bearer zdk_live_…"

Connecté ? La console d'API de votre tableau de bord saisit votre véritable ID d'organisation ainsi que votre propre clé, et exécute la requête sur l'API de production afin que vous puissiez voir la réponse réelle. Ouvrir ce point de terminaison dans la console API

Détails

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.

Paramètres

NomTypeObligatoireQu'est-ce que c'est
siteId (path)UuidOuiSite ID (UUIDv7).

Réponse

NomTypeObligatoireQu'est-ce que c'est
availablebooleanOuiWhether a metrics sample has been collected for this site yet.
disk_used_mbobjectOuiDisk 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_mbobjectOuiThe 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_mbobjectOuiBandwidth used in the current period.
visitsobjectOui
php_versionstringNonThe PHP version the site runs; empty when not applicable/unknown.
serving_okobjectNonWhether 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_atobjectNonWhen 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_detailstringNonThe short status line behind serving_ok"HTTP 522", "ConnectTimeout". Never a raw vendor response body.
ssl_statusstring<active, pending, none, unknown>NonThe site's TLS certificate state.
ssl_expires_atobjectNon
bandwidth_seriesinteger[]OuiRecent daily bandwidth samples (MB), oldest first — for the usage chart. Empty when unavailable.
collected_atobjectOuiWhen this sample was collected; null when unavailable.
error_rateSiteErrorRateOuiHTTP and PHP errors for one site over the newest closed collection window (#626). What features/uptime-monitoring sells:…

Erreurs que cet point de terminaison peut renvoyer

401 · 403 · 404 · 429