API Reference
Login with credentials
/api/auth/login
Validates password and sets a pending browser session. Requires TOTP verification to complete.
Operation IDlogin
Authentication
No authentication is required.
Request body
This request body is required.
Content typeapplication/json
requestobject2 properties
usernamestringrequiredpasswordstringrequiredSuccess response body
200Credentials valid. When TOTP is required, sets a pending browser session and returns the TOTP status flags. When TOTP is disabled (`auth.totp_required: false`), sets the authenticated browser session immediately and returns `{ authenticated: true }`.
Credentials valid. When TOTP is required, sets a pending browser session and returns the TOTP status flags. When TOTP is disabled (auth.totp_required: false), sets the authenticated browser session immediately and returns { authenticated: true }.
Content typeapplication/json
responseobject4 properties
requires_totpbooleanTrue if the user has a TOTP secret and needs to verify it
needs_totp_setupbooleanTrue if the user has no TOTP secret and needs to enroll
can_restart_totp_setupbooleanTrue if an unverified TOTP enrollment exists and can be explicitly restarted
authenticatedbooleanTrue when TOTP is disabled and a full session was issued
Error responses
401Not authenticated
Not authenticated
Content typeapplication/json
responseobject2 properties
errorstringmessagestringExample response
{
"error": "AUTH_ERROR",
"message": "Not authenticated"
}429Too many requests
Too many requests
Content typeapplication/json
responseobject2 properties
errorstringmessagestringExample response
{
"error": "RATE_LIMITED",
"message": "Too many failed TOTP attempts. Try again later."
}