RelayrtcDocs
Get started
Documentation
REST API v1

All usage

Read all usage for the key's project environment.

GET/v1/usage
On this page

Requirements

A secret API key with usage:read. Resources are restricted to the key's project and environment.

Query parameters

NameTypeRequired / defaultDescription
rangestring7d24h, 7d, 14d or 30d. Cannot combine with boundaries.
startedAtISO datetimeWith endedAtInclusive start, within retained history.
endedAtISO datetimeWith startedAtExclusive end. Must be in the past.
granularitystringAutomatichour for windows ≤24h, otherwise day.
projectIdstringKey projectMust match the key's project.
environmentIdstringKey environmentMust match the key's environment.

Example

Set RELAYRTC_API_URL to your API base including /v1, such as http://localhost:8080/v1.

Shell
curl -X GET "$RELAYRTC_API_URL/usage?range=7d&granularity=day" \
  -H "Authorization: Bearer $RELAYRTC_SECRET_KEY"

Response

200 with scope, category, window, bucketDefinition, metricDefinitions, summary, buckets and dataQuality.

Included metrics: All public category metrics.

The API includes serviceUsage for streaming and retained assets while preserving the RTC fields. GET /v1/usage/streaming returns this service report with an empty RTC summary. Use a compatible API deployment with service-usage reporting enabled. See streaming and asset usage for metrics, coverage and REST examples.

Notes

Explicit windows must be positive, at most 30 days, and within retained history. Times and calendar buckets use UTC; the end boundary is exclusive.

participantMinutesDerived is seconds divided by 60. It is a decimal number of minutes. Check dataQuality before treating missing TURN history as zero. See usage response fields.

Errors

Invalid fields return 400. Invalid credentials return 401; a missing scope returns 403. A missing resource returns 404. See error responses.