Metrics API docs

API reference

Version 2. All endpoints require a bearer token.

Authentication

Send the token in the Authorization header: Authorization: Bearer $TOKEN. Tokens are scoped; a request outside the token scope returns 403.

Events

MethodPathDescription
POST/v1/eventsStore one event.
POST/v1/events/batchStore up to 500 events in one request.

Event fields: metric (string, required), value (number, default 1), timestamp (ISO 8601, default now), dimensions (object, up to three string keys).

Metrics

MethodPathDescription
GET/v1/metricsList metric names in the workspace.
GET/v1/metrics/{name}Return buckets for a time range. Parameters: from, to, step, group_by.
DELETE/v1/metrics/{name}Delete a metric and its history.

Errors

StatusMeaning
400The request body is not valid JSON or a required field is missing.
401The token is missing, expired or revoked.
403The token does not have the required scope.
404The metric does not exist.
429Rate limit exceeded; retry after the number of seconds in Retry-After.

Rate limits

Each token may send 600 requests per minute. A batch counts as one request. Query endpoints are limited to 120 requests per minute per token.