Skip to content

History window

GET /devices/{device_id}/telemetry takes an optional window:

Parameter Meaning
after Earliest reading to return, RFC 3339.
before Latest reading to return, RFC 3339.

A timestamp sent without an offset is read as UTC.

How wide one request’s window may be is your plan’s history_max_days, published on the account endpoint. Readings older than that are not lost — you reach them by moving the window back — but no single request may span more than it.

  • Both bounds given: the window is exactly after to before. Wider than history_max_days is refused with 422 range_too_large, and max_days in the response tells you the most you may ask for.
  • One bound given: the other is filled in history_max_days away (capped at now).
  • Neither given: you get the most recent history_max_days of readings.
  • history_max_days is null: the plan sets no maximum. With no bounds you get the most recent 30 days; with bounds, any explicit window is accepted.

after must be earlier than before; otherwise the request is refused with 422 invalid_request.

Chunk it: walk backwards in windows no wider than max_days, and page within each window using its next_cursor (see Pagination). The window is carried inside the cursor, so a chunk stays anchored while you page through it.