POST /api/auth/login
Authenticates a user and returns a JWT token. Supports TOTP-based two-factor authentication.Request
Registered email address.
Account password.
Six-digit TOTP code from an authenticator app. Required if 2FA is enabled on the account.
One-time backup code. Use this instead of
totpCode if the authenticator app is unavailable.Response
- 200 Success
- 200 2FA Required
- 401 Invalid Credentials
Two-Factor Authentication Flow
When 2FA is enabled on an account, the login process requires two steps:The
totpCode and backupCode fields are mutually exclusive. Provide one or the other, not both. Backup codes are single-use and are consumed upon successful authentication.Token Lifetime
JWT tokens expire after 24 hours by default. TheexpiresAt field indicates the exact expiration timestamp. To maintain a session, re-authenticate before the token expires.