POST
Admin login (step 1 of 2)

Overview

The admin surface uses a deliberately separate, MFA-gated auth flow from the user surface. Login is two steps:
  1. POST /admin/auth/login (this page) — verifies email + password and, on success, returns a short-lived mfaTicket. No access or refresh token is issued here.
  2. POST /admin/auth/mfa-verify — exchanges the mfaTicket + a 6-digit TOTP code for the actual accessToken + refreshToken pair.
See Admin auth and MFA for the full rationale (why a separate flow, blast-radius isolation, TOTP enrollment).
This endpoint requires no authentication. It is brute-force surface, so the shared 10-requests-per-minute-per-IP burst limiter is applied.

Authentication

None. Public endpoint.

Path parameters

None.

Query parameters

None.

Request body

Example payload

Response — 200 OK

Error responses

ADMIN_INVALID_CREDENTIALS is intentionally returned for both a wrong password and a non-existent admin, and the server pays the full Argon2-verify cost on the missing-admin path so response timing cannot reveal which emails exist.

Example error — 401 ADMIN_INVALID_CREDENTIALS

See also

curl

Postman

See docs/postman/swappr.postman_collection.json → Admin Auth → Login.