Loading FlowZen
Getting your workspace ready...
Getting your workspace ready...
FlowZen uses NextAuth.js for web authentication. For mobile/Android apps, use the Mobile Login endpoint which returns a JWT token.
Mobile Auth: Use POST /api/auth/mobile-login to get a JWT token. Include it in all subsequent requests as Authorization: Bearer <token>.
/api/auth/mobile-loginLogin with email and password. Returns a JWT token for mobile app authentication. Use this for Android/iOS apps instead of NextAuth session.
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Required | Registered email address |
password | string | Required | Account password |
| Status | Message |
|---|---|
401 | Invalid email or password |
401 | This account uses social login |
403 | Please verify your email with the OTP sent during signup before logging in. |
/api/auth/registerCreate a new user account. Sends a 6-digit OTP to the provided email for verification.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Required | Full name |
email | string | Required | Email address |
password | string | Required | Password (min 8 chars) |
role | string | Optional | Role (employee, project-manager, qa-tester, human-resource, finance, admin, security, it-admin, it-administration, others). Default: employee |
| Status | Message |
|---|---|
400 | Name, email, and an 8+ character password are required |
409 | An account with this email already exists |
500 | Unable to send OTP email |
/api/auth/verify-otpVerify email with OTP code sent during registration. Returns a JWT token for mobile app authentication.
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Required | Email address |
otp | string | Required | 6-digit OTP code |
/api/auth/forgot-passwordSend password reset email.
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Required | Registered email address |
/api/auth/check-pendingCheck if user has pending approval.
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Required | Email address (query param) |
For users who signed up via social login (Google, GitHub, etc.) with unverified emails. These endpoints require an authenticated session or Bearer token.
/api/auth/oauth/send-otpSend a 6-digit OTP to the user's email for verification. Requires authentication.
| Status | Message |
|---|---|
401 | Unauthorized |
400 | Credentials accounts already use email verification |
400 | Account is already verified |
/api/auth/oauth/verify-otpVerify the OTP sent to the user's email. Requires authentication.
| Field | Type | Required | Description |
|---|---|---|---|
otp | string | Required | 6-digit OTP code |
| Status | Message |
|---|---|
401 | Invalid OTP |
410 | OTP expired. Request a new one. |
/api/auth/session-modeSet session mode for the current user.
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | Required | Session mode |