Documentation Index
Fetch the complete documentation index at: https://dev.1st.app/llms.txt
Use this file to discover all available pages before exploring further.
Key format
Every API key looks like this:- key_id is the public identifier — stable, lookup-able server-side.
- secret is the actual credential — only ever stored as an HMAC on our side, and shown to you ONCE at mint time.
Use the key
Every request needs anAuthorization: Bearer <full_key> header:
Treat it like a password
API keys grant read access to every sensor reading in your team. Same blast radius as a leaked dashboard password. The fix-it pattern:- Notice the key may have leaked (committed to a public repo, pasted in chat, sent to a contractor who left).
- Open Integrations → API access.
- Click Revoke on the affected key. It stops working within seconds.
- Mint a fresh key. Update your integration’s
ST_API_KEYenv var.
Where to store the key
- Env var, always.
ST_API_KEYis the convention in our examples. - A secret manager for production integrations (AWS Secrets Manager, Doppler, Vercel encrypted env, GitHub Actions secrets).
- Never commit it to a repo, paste it into a Notion doc, or share it in Slack.
Expiry
Keys can optionally carry anexpires_at set at mint time (90 days,
1 year, or never). Once the date passes the middleware rejects every
request from the key with api_key_expired. The expiry column is
visible on the API keys list so you can rotate before it bites.
Rotation (no-downtime)
To rotate without an outage:- Mint the new key under Integrations → API access.
- Update your integration to use the new key.
- Verify a successful request lands (
GET /v1/team). - Revoke the old key.
Scopes
Two scopes in V1:- read — list sensors, current conditions, time-series readings, CSV export. Default for new keys.
- read_write — everything
readdoes, plusPATCH /v1/sensors/{id}to update display names and metadata.
How verification works
The server storesHMAC-SHA-256(server_secret, secret) for each key — never
the plaintext. When you make a request, we look up your key_id, compute
the HMAC over the secret you sent, and constant-time compare against the
stored hash.
This means even an attacker with a database dump cannot derive a usable
key, because the server-side HMAC pepper is held outside the database.
Errors
If authentication or authorization fails, you’ll get one of these codes:| Code | Cause | Fix |
|---|---|---|
api_key_missing | No Authorization header. | Add the header. |
api_key_invalid | Header malformed, key prefix doesn’t match, or secret wrong. | Re-copy the key from the app. |
api_key_revoked | Key was revoked. | Mint a new key. |
api_key_expired | Key passed its expiry date. | Mint a new key, optionally with longer expiry. |
insufficient_scope | Key doesn’t have write scope but called PATCH. | Mint a read_write key. |