01
Log in
POST /apis/v1/auth/login
{
"user": {
"username": "person@example.com",
"password": "your-password"
}
}| Response field | Description |
|---|---|
access_token | Send it in the Authorization header for protected routes. |
refresh_token | Use it to refresh the session. |
token_type | Bearer. |
expires_in | Lifetime of the access token. |
requires_2fa | Whether the account still has a TOTP step to complete. |
If requires_2fa is true, complete the account’s TOTP step before you treat the client as fully authenticated. For the user’s side of two-factor sign-in, see Settings: security.
02
Refresh a session
POST /apis/v1/auth/refresh
- Send
refresh_tokeneither at the top level or underuser.refresh_token. - Ration rotates the refresh token and returns a new bearer access token.
- An invalid or expired refresh token returns
401withinvalid_refresh_token.
03
Sign out
POST /apis/v1/auth/logout or DELETE /apis/v1/auth/logout
- This is a protected route. Send the bearer token.
- An optional
user.usernamenames the account. Without it, the authenticated user is signed out.
04
Password recovery
| Operation | Route | Request |
|---|---|---|
| Start recovery | POST /apis/v1/auth/reset-password | {"user":{"login":"person@example.com"}} (an email or username can be used) |
| Finish recovery | POST /apis/v1/auth/update-password | email, temp_user_key and password |
Starting recovery is rate limited. The finish route checks the temporary reset key and returns 401 when it is invalid, expired or belongs to a different email.
05
Two-factor management
These routes are protected and act on the authenticated user. Paths are relative to /apis/v1.
| Method | Route | Purpose |
|---|---|---|
POST | /auth/initiate-2fa | Start TOTP setup. |
POST | /auth/enable-2fa | Enable the newly configured factor. |
POST | /auth/verify-2fa | Verify a TOTP code. |
POST | /auth/disable-2fa | Disable TOTP after the required verification. |
Never log or store a TOTP setup secret, QR payload, token, access token or refresh token. For profile settings, signatures, app-specific passwords and the full TOTP contract, see the Settings API.
Last reviewed 27 November 2026.