Skip to content

HTTP API

Machine-readable contract:

Authentication

AudienceMechanism
Device firmwareDevice key in /api/ingest/{deviceKey} (or X-Ingest-Key for MQTT bridge)
Pro integrationsBearer API key from Dashboard → Share
Browser dashboardSupabase session cookies (not for third-party clients)
Share linksOpaque token in the URL path

Endpoint map

MethodPathAuthPurpose
POST/api/ingest/{deviceKey}Path keyPush sensor readings
POST/api/ingest/mqttX-Ingest-KeyMQTT→HTTP bridge
POST/api/user/pull-setupSession cookieSave pull feeds + probe labels (JSON body)
POST/api/devices/reveal-ingest-keySession cookieRecover encrypted push ingest key (rate-limited; audited)
GET/api/v1/metricsBearer API keyPrometheus text exposition
GET/api/v1/devicesBearer API keyList household devices
POST/api/v1/devicesBearer API keyCreate push device
POST/api/inbound/{token}Token (+ optional HMAC)Snooze / vacation / status actions
GET/api/share/{token}/readingsShare tokenPublic JSON readings (Free family live; Pro expands scopes)
POST/api/pucks/registerCompanion sessionRegister claim-puck secret
POST/api/pucks/claim/startCompanion sessionIssue claim nonce
POST/api/pucks/claim/finishCompanion sessionVerify HMAC and bind bay
GET/api/bays/{bay_id}/moodCompanion sessionDerived bay mood (Bay Buddy / claim puck)
PUT/api/bays/{bay_id}/moodCompanion sessionOverride mood (demo / test)

Claim puck

Physical RP2040-Zero presence key. Product page: thermaltrace.dev/claim-puck. Firmware: thermaltrace-claim-puck.

Auth matches Bay Buddy: Authorization: Bearer <access> + X-SB-Refresh-Token: <refresh>.

Flow: registerclaim/start → device CHALLENGE + button → claim/finish → poll GET /api/bays/{bay}/mood.

Create an API key (Pro)

  1. Sign in → Dashboard → Share
  2. Create an API key; copy it once
  3. Call:
bash
curl -sS "https://thermaltrace.dev/api/v1/metrics" \
  -H "Authorization: Bearer YOUR_API_KEY" | head

Example: list devices

bash
curl -sS "https://thermaltrace.dev/api/v1/devices" \
  -H "Authorization: Bearer YOUR_API_KEY"

Spec versioning

openapi.yaml in the repo (public/openapi.yaml) is the source of truth. The docs build copies it into this site on every Pages deploy.

Legacy per-feed routes (/api/user/temp-feeds, /api/user/temp-probes) are retired — use POST /api/user/pull-setup instead.

App & product guides: thermaltrace.dev · This site: developer reference