Skip to content

HTTP API — overview & auth

The collector exposes one ingestion endpoint and a set of read endpoints. All requests authenticate with a project API key in the x-api-key header; the project is resolved from the key server-side, so a client can only ever read or write its own data.

Terminal window
KEY= # a project API key
BASE=https://collect.example.com # or http://localhost:8787 locally
curl -s -H "x-api-key: $KEY" "$BASE/api/v1/sessions?limit=20"
  • No key / unknown key → 401.
  • There is no cross-project query — a caller can only ever read its own data.
  • Do not add a projectId query param to “widen” a query; it is ignored.

Binned and aggregate endpoints accept these (coerced and bounded by Zod at the edge — out-of-range values are rejected with 400, not clamped):

ParamUnit / typeNotes
sinceepoch millisecondsRange start. Omit for the server default window.
untilepoch millisecondsRange end.
bins1500Bin count for binned heatmaps.
limit11000Result cap on list/top endpoints (no cursors beyond this).
cellSize> 0, ≤ 1000Voxel size in world units for world / click-ray heatmaps.
intervalsecondsBucket width for timeseries.
sceneidScope to one scene/area/level (the value passed to setScene).
sourceenumInput-source filter: mouse, touch, stylus, pen, xr-controller, hand, gaze, transient, other.
sessionidScope an aggregate to a single session.
cameraModeviewer | first-personRestrict to orbit (viewer) or free/walkable (first-person) camera sessions.

For an AI agent (or any MCP client) that should read analytics, use the read-only @uptimizr/mcp server instead of hand-rolling HTTP calls. It wraps each read endpoint as a typed, GET-only tool, configured with UPTIMIZR_COLLECTOR_URL + UPTIMIZR_API_KEY. It exposes no ingestion, mutation, or raw-event tools.