zazzy
API reference

API reference

The public /api/v1 REST surface — bearer auth, scopes, rate limits, and one error envelope.

The starter ships a small public REST API at /api/v1, meant for machine integrations that authenticate with a bearer API key rather than a user session. Each endpoint page below is generated from a hand-authored OpenAPI 3.1 document (apps/docs/openapi.json); a coverage test pins that document to the real route tree, so the reference cannot silently drift from the code.

Authentication

Every request must carry an API key as a bearer token:

GET /api/v1/me HTTP/1.1
Authorization: Bearer sk_live_...

Keys are minted in Account settings → API keys; the full secret is shown once, at creation. The scheme match is case-insensitive, but the token is taken verbatim. A missing, malformed, unknown, revoked, or expired key is rejected with one indistinguishable 401 — a probe cannot tell those cases apart.

Scopes

A key is granted the coarse read or write scope (v1). write implies read, so a write key satisfies a read requirement. Both endpoints here require read; a key without it gets a 403.

Rate limiting

Requests are counted per key against a per-minute limit. A capped key's responses (both the served response and a 429) carry:

HeaderMeaning
X-RateLimit-LimitThe per-minute ceiling.
X-RateLimit-RemainingRequests left in the window.
X-RateLimit-ResetWhole seconds until the window resets.
Retry-AfterSent only on a 429: seconds to wait.

An uncapped key carries none of these headers. Over the limit, the request short-circuits with a 429 before the handler runs.

Errors

Every failure serializes to one envelope:

{ "error": { "code": "UNAUTHORIZED", "message": "Invalid API key." } }
StatuscodeWhen
401UNAUTHORIZEDMissing / invalid / revoked / expired key.
403FORBIDDENKey lacks the required scope.
404NOT_FOUNDThe requested resource does not exist.
429RATE_LIMITEDPer-minute limit exceeded.
500INTERNALUnexpected server fault (opaque; correlate via X-Request-Id).

Request correlation

Every response echoes an X-Request-Id header (an inbound x-request-id is honored, otherwise one is generated). Include it when reporting an issue so the request can be traced in the logs.

On this page