Skip to main content

Register

POST /api/auth/register
Creates a new user account and sends a 6-digit verification code to the provided email. If the email already exists but is not yet verified, the password and display name are updated.
Rate limited to 10 requests per 60 seconds.

Request body

string
required
A valid email address.
string
required
Password - minimum 8 characters.
string
Optional display name for the user.

Response 201

Response 409

Returned when a verified user with this email already exists.

Verify email

POST /api/auth/verify-email
Verifies the user’s email with the 6-digit code sent during registration. On success, the user is automatically logged in and receives tokens.
Rate limited to 5 requests per 60 seconds.

Request body

string
required
The email address to verify.
string
required
The 6-digit verification code. Must be exactly 6 characters.

Response 200

Returns the user profile, tokens, and service access - identical to a login response.

Response 401


Resend verification

POST /api/auth/resend-verification
Resends the email verification code. The previous code is invalidated and a new one is generated with a 15-minute expiry.
Rate limited to 3 requests per 60 seconds.

Request body

string
required
The email address to resend the verification code to.

Response 200

Response 409


Login

POST /api/auth/login
Authenticates a user with email and password. If the user has 2FA enabled, the first call returns a requires2FA flag - call login again with the verificationCode field.
Rate limited to 30 requests per 60 seconds.

Request body

string
required
User’s email address.
string
required
User’s password.
string
TOTP verification code. Required on the second call when 2FA is enabled.

Flow: standard login

Response 200

Flow: 2FA login (two-step)

Step 1 - Login without verification code:
Response:
Step 2 - Login with TOTP code:
Returns the standard login response with tokens.

Response 401

If the user’s email is not verified, a new verification code is sent automatically.

Refresh tokens

POST /api/auth/refresh
Exchanges a valid refresh token for a new access token and a new refresh token. The old refresh token is revoked immediately (rotation).
Refresh tokens are valid for 30 days. Each refresh token can only be used once - a new one is issued with each rotation.

Request body

string
required
The current refresh token.

Response 200

Response 401


Get current user

GET /api/auth/me
Returns the authenticated user’s profile.
This endpoint requires authentication. You must provide a valid Authorization: Bearer <token> header.

Response 200


Logout

POST /api/auth/logout
Revokes the current session and all associated refresh tokens.
Requires Authorization: Bearer <token> header. The session ID is extracted from the JWT.

Response 200


Delete account

POST /api/auth/delete-account
Permanently deletes the user’s account and all associated data. Requires password confirmation and, if enabled, a 2FA code.
This action is irreversible. All user data, sessions, service entitlements, and audit logs are permanently deleted.

Request body

string
Required if the account has a password (non-OAuth-only accounts).
string
Required if 2FA is enabled on the account.

Response 200


Toggle 2FA

POST /api/auth/2fa
Enables or disables two-factor authentication. Enabling 2FA is a two-step process.

Enable 2FA (step 1) - get QR code

Response:

Enable 2FA (step 2) - confirm with TOTP code

Response:

Disable 2FA

Response: