Skip to content

Get deployment traffic

GET/v1/deployments/{uid}/traffic

Returns 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

uidstringRequired

The deployment's uid.

Query parameters

rangestring

Time range to return.

Default 1hOne of15m1h6h24h7d30d

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

Response

200

The traffic summary.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
deployment_uidstringRequired

UID of the deployment.

availablebooleanRequired

false when traffic data could not be read. The other totals are then 0.

rangestringRequired

The requested range.

step_secondsintegerRequired

Width of each bucket in points, in seconds.

requests_totalintegerRequired

Requests served in the range.

errors_totalintegerRequired

Requests that returned a 5xx status.

error_ratenumberRequired

errors_total / requests_total, from 0 to 1.

min 0 · max 1

rx_bytesintegerRequired

Bytes received from clients.

tx_bytesintegerRequired

Bytes sent to clients.

pointsarray of objectsRequired

Requests and errors per bucket, oldest first.

Show item attributes
timestampstring (date-time)Required

End of the bucket.

requestsnumberRequired

Requests in the bucket.

errorsnumberRequired

5xx responses in the bucket.

unavailable_reasonstring

Why traffic is unavailable: traffic metrics are not available in this environment, this app has no public route or traffic metrics are temporarily unavailable.

Errors

StatusMeaning
400range is not one of the allowed values.
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.
404The resource does not exist or you cannot access it.

Errors use the standard error format.