REST API overview
The HTTP API is the single source of truth. This section documents it with real
curl examples; the machine-readable contract is
openapi/openapi.yaml
(OpenAPI 3.1).
Base URL
Self-hosted, the base URL is your deployment, e.g. http://localhost:8080 in dev
or https://auth.example.com in production. All paths below are relative to it.
Namespaces
| Prefix | Audience | Credential |
|---|---|---|
/v1/... | Runtime (end users) | user session + X-Client-Id |
/v1/projects/{id}/admin/... | Project admin | adminToken |
/mgmt/v1/... | Operator | masterKey |
/oauth2/..., /p/{id}/e/{env}/.well-known/... | OIDC provider | OAuth client creds |
/v1/scim/v2/{connection_id}/... | SCIM | scimToken |
Conventions
- JSON in, JSON out.
Content-Type: application/jsonon request bodies. - Project & environment come from the
X-Client-IdandX-Environmentheaders on runtime calls — see Authentication. - Errors use a single stable envelope — see Errors.
Branch on
error.code, never on the HTTP status or the localized message. - Idempotency. Create-style POSTs accept an optional
Idempotency-Keyheader for safe retries. - Pagination. List endpoints return
{ data, next_cursor, has_more }; pass?cursor=<next_cursor>&limit=<n>for the next page.
Where to start
- Authentication — headers, bearer vs cookie mode, CSRF.
- Auth flows — the resumable
/v1/auth/flowsstate machine (recommended integration path). - Runtime endpoints — sign-up/in, OTP, magic link, MFA, WebAuthn, OAuth, tokens, sessions.
- Admin & operator — managing projects, users, config, webhooks, and more.
- Errors — the error envelope and the full code table.