Skip to main content

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​

PrefixAudienceCredential
/v1/...Runtime (end users)user session + X-Client-Id
/v1/projects/{id}/admin/...Project adminadminToken
/mgmt/v1/...OperatormasterKey
/oauth2/..., /p/{id}/e/{env}/.well-known/...OIDC providerOAuth client creds
/v1/scim/v2/{connection_id}/...SCIMscimToken

Conventions​

  • JSON in, JSON out. Content-Type: application/json on request bodies.
  • Project & environment come from the X-Client-Id and X-Environment headers 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-Key header 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/flows state 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.