A Auth API docs

Integrate

Errors, limits and retries

Error shape

Every error is JSON with a single error field:

{ "error": "Invalid email or password" }

Validation errors return the validator's message, so surface it next to the field rather than as a toast.

Status codes

StatusMeaningWhat the client should do
400Malformed body, missing X-App-ID, invalid valueFix the request; do not retry
401Missing/expired token, wrong credentials, invalid 2FA codeRe-authenticate or refresh the token
403Email not verified, 2FA/feature disabled for the app, permission deniedExplain the state to the user
404Unknown resource or routeCheck the id
409Conflict (duplicate email in the application, duplicate social link)Treat as "already exists"
423Account locked by brute-force protectionShow the unlock time from the body
429Rate limitedBack off, then retry
500Server errorRetry with backoff; report with logs

Rate limits

Public endpoints are rate limited per IP and per application: registration, login, refresh, password reset, 2FA verification, magic links, passkeys, OIDC authorize/token and SSO. Exceeding a limit returns 429:

{ "error": "Too many requests. Please wait a moment before trying again." }

The limits are deliberately strict on authentication endpoints. A frontend should:

  1. Disable the submit button while a request is in flight.
  2. On 429, show a countdown instead of retrying immediately.
  3. Never retry a failed login automatically — it counts against the same window.

Brute-force protection

Beyond rate limiting, the application can lock an account after repeated failures, introduce progressive delays and require a CAPTCHA (per-application overrides in the GUI, defaults from the environment). A locked account returns 423; the admin GUI can unlock it, and POST /login accepts captcha_token when CAPTCHA is required.

Failures are counted per application and identifier (email or IP), so retrying from a different network does not reset the email counter.

Token errors

SituationResult
Access token expired401 — call POST /refresh-token
Access token blacklisted (logout, password change)401 — force a new login
Refresh token already rotated401 — treat as compromised, log the user out
Temporary 2FA token expired (10 min)401 — restart the login
Session revokedRefresh fails; the access token expires within its TTL

Idempotency and retries

The API does not implement idempotency keys. Safe-to-retry calls are the read endpoints and POST /refresh-token (with the current token). Do not blindly retry:

  • POST /register — a retry may hit the duplicate-email conflict.
  • POST /2fa/login-verify — codes are single-use.
  • POST /magic-link/verify and POST /sso/exchange — tokens are single-use.
  • POST /reset-password — the reset token is consumed on success.

Correlation

Every response carries the standard server headers; the API logs the request line, status, latency, IP and user agent. When reporting a bug, include the timestamp (with timezone), the endpoint, the X-App-ID and the response body — never include tokens.