/v1/deployments/{uid}/trafficReturns HTTP traffic served through the deployment's public route over the chosen range: request and 5xx error counts per time bucket, totals, the error rate and bytes in and out. Traffic on the platform hostname and on all custom domains is added together.
When traffic data cannot be read (not available in this environment, the app has no public
route, or the metrics backend is temporarily down), the response is still 200 with
available: false and a reason in unavailable_reason.
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe deployment's uid.
Query parameters
rangestringTime range to return.
Default 1hOne of15m1h6h24h7d30d
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Response
The traffic summary.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
deployment_uidstringRequiredUID of the deployment.
availablebooleanRequiredfalse when traffic data could not be read. The other totals are then 0.
rangestringRequiredThe requested range.
step_secondsintegerRequiredWidth of each bucket in points, in seconds.
requests_totalintegerRequiredRequests served in the range.
errors_totalintegerRequiredRequests that returned a 5xx status.
error_ratenumberRequirederrors_total / requests_total, from 0 to 1.
min 0 · max 1
rx_bytesintegerRequiredBytes received from clients.
tx_bytesintegerRequiredBytes sent to clients.
pointsarray of objectsRequiredRequests and errors per bucket, oldest first.
Show item attributesHide item attributes
timestampstring (date-time)RequiredEnd of the bucket.
requestsnumberRequiredRequests in the bucket.
errorsnumberRequired5xx responses in the bucket.
unavailable_reasonstringWhy traffic is unavailable: traffic metrics are not available in this environment,
this app has no public route or traffic metrics are temporarily unavailable.
Errors
| Status | Meaning |
|---|---|
400 | range is not one of the allowed values. |
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
404 | The resource does not exist or you cannot access it. |
Errors use the standard error format.