MetricsGET /metrics/{id}/history

GET /metrics/{id}/history

Aggregated metric values over a window (max 30 days)

Parameters

NameInRequiredTypeDescription
idpathyesstring
fromqueryyesstring
toquerynostring
resolutionquerynostring

Example request

curl -X GET "/api/v1/metrics/{id}/history" \
  -H "Authorization: Bearer YOUR_API_KEY"

Responses

200: ok

{
  "resolution": "1m",
  "from": "2026-01-01T00:00:00.000Z",
  "to": "2026-01-01T00:00:00.000Z",
  "items": [
    {
      "bucket": "2026-01-01T00:00:00.000Z",
      "avg_value": null,
      "max_value": null,
      "min_value": null,
      "sample_count": 0
    }
  ]
}

400: invalid request

One of:

  • missing_paramfrom is required, as an ISO 8601 timestamp.
  • invalid_rangefrom must be ISO 8601 and strictly earlier than to.
  • invalid_resolution — the requested resolution is not one of the supported values; detail lists them.
  • range_too_large — the window exceeds the 30-day maximum.

401: missing or invalid bearer token

title: unauthenticated. No bearer token was sent, or the key is invalid or revoked. detail distinguishes the two.

403: missing required scope

title: forbidden. The key is valid but does not carry read:metrics.

404: not found

title: not_found. No metric with that id is available to this key. A metric owned by another organisation returns the same response, so a 404 does not confirm that the id is unused.

429: rate limit exceeded

title: rate_limited. A burst or daily limit was exceeded; detail names which. The body carries retry_after in seconds.

500: internal error

title: internal_error. An unhandled server error. Safe to retry.

Every error is an RFC 7807 problem detail served as application/problem+json:

{
  "type": "https://observer.example/problems/forbidden",
  "title": "forbidden",
  "status": 403,
  "detail": "missing scope: read:metrics"
}

Branch on title, not on detail. See Errors and status codes for the full catalogue and the rate-limit headers.