Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cgwire/zou/llms.txt
Use this file to discover all available pages before exploring further.
Login
POST /api/auth/login
Log in user by creating and registering JWT auth tokens. Login is based on email and password. If no user matches the given email, it fallbacks to a desktop ID. This is useful for desktop tools that don’t know the user email. The endpoint also supports two-factor authentication via TOTP, Email OTP, FIDO, and recovery codes.Request Body
User email addressExample:
admin@example.comUser passwordExample:
mysecretpasswordTOTP verification code for two-factor authenticationExample:
123456Email OTP verification code for two-factor authenticationExample:
123456FIDO authentication response for WebAuthn
Recovery code for two-factor authenticationExample:
ABCD-EFGH-IJKL-MNOPResponse
Whether the login was successful
User information including id, email, first_name, last_name, role, and other profile data
Organisation information
JWT access token for API authentication
JWT refresh token to obtain new access tokens
Present when 2FA setup is enforced but not yet configured
Error Responses
Indicates login failure
Indicates an error occurred
User must change their default password
Password reset token when default_password is true
Two-factor authentication code is required but not provided
Provided OTP code is incorrect
Account locked due to too many failed login attempts
Error message description
Status Codes
200- Login successful400- Login failed (wrong credentials, missing OTP, or validation error)401- User is inactive409- Authentication strategy not properly configured500- Server error (database unreachable or internal error)
Check Authentication Status
GET /api/auth/authenticated
Check if the user is still authenticated. Returns user information if authenticated. This endpoint can be used by third-party tools, especially browser frontends, to verify if the current user is still logged in.Headers
Bearer token for authenticationFormat:
Bearer <access_token>Response
Always true when request succeeds
Current user information including profile data, role, and FIDO devices
Organisation information (sensitive data included for admin users)
Status Codes
200- User authenticated401- Person not found or invalid token
Logout
GET /api/auth/logout
Log user out by revoking auth tokens. Once logged out, the current user cannot access the API anymore.Headers
Bearer token for authenticationFormat:
Bearer <access_token>Response
Always true when logout succeeds
Status Codes
200- Logout successful401- Invalid or missing token500- Access token not found
User Registration
POST /api/auth/register
Allow a user to register themselves to the service.Request Body
User email addressExample:
newuser@example.comUser password (must meet minimum length requirements)
Password confirmation (must match password)
User’s first name
User’s last name
Response
Whether registration was successful
Indicates an error occurred
Error message when registration fails
Status Codes
201- Registration successful400- Invalid password, email, or passwords don’t match
Change Password
POST /api/auth/change-password
Allow the user to change their password. Requires current password for verification and password confirmation to ensure accuracy.Headers
Bearer token for authenticationFormat:
Bearer <access_token>Request Body
Current password
New password
New password confirmation
Response
Whether password change was successful
Indicates an error occurred
Error message description
Status Codes
200- Password changed successfully400- Invalid password, passwords don’t match, old password is wrong, or user is inactive
After a successful password change, a confirmation email is sent to the user’s email address.
Password Reset
Request Password Reset
POST /api/auth/reset-password
Send a password reset token by email to the user. It uses a classic scheme where a token is sent by email with a 2-hour expiration.Request Body
User email addressExample:
user@example.comResponse
Message indicating reset token was sent
Indicates an error occurred
Error message description
Status Codes
200- Reset token sent successfully400- Email not listed in database or user is inactive
Reset Password with Token
PUT /api/auth/reset-password
Allow a user to change their password when they forget it. It uses a token sent by email to verify it is the user who requested the password reset.Request Body
User email addressExample:
user@example.comPassword reset token received via email
New password
New password confirmation
Response
Whether password reset was successful
Indicates an error occurred
Error message description
Status Codes
200- Password reset successful400- Invalid password, passwords don’t match, wrong or expired token, or inactive user