Email Registration
POST /api/client/accounts/emails/register
Register a new account with email and password
Request Body
User’s full name (1-100 characters, trimmed)
Valid email address
Password meeting the following requirements:
- Minimum 8 characters
- Maximum 128 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one number
Request Schema
Response
Either
"success" or "verify"Success Response (type: “success”)
Array of workspace objects the user has access to
Unique device identifier
JWT authentication token
Verify Response (type: “verify”)
OTP verification ID
OTP expiration timestamp
Error Codes
400-EmailAlreadyExists: Email already registered400-AccountCreationFailed: Failed to create account400-AccountPendingVerification: Account requires verification429-TooManyRequests: Rate limit exceeded
Email Login
POST /api/client/accounts/emails/login
Authenticate with email and password
Request Body
Email address
Account password
Request Schema
Response
Same as registration - returns discriminated union ofsuccess or verify type.
Error Codes
400-EmailOrPasswordIncorrect: Invalid credentials400-AccountPendingVerification: Account not verified429-TooManyRequests: Rate limit exceeded
Google Login
POST /api/client/accounts/google/login
Authenticate with Google OAuth
Request Body
Google OAuth authorization code
Request Schema
Response
Same as email login - returns discriminated union ofsuccess or verify type.
Behavior
- If account exists with email: Updates Google ID and activates if email verified
- If account doesn’t exist: Creates new account with Google profile data
- Downloads and stores Google profile picture as avatar (500x500px JPEG)
- Only allows images from trusted Google domains
Error Codes
400-GoogleAuthFailed: Google authentication failed400-AccountCreationFailed: Failed to create account
Email Verification
POST /api/client/accounts/emails/verify
Verify email with OTP code
Request Body
OTP verification ID (from registration response)
One-time password code
Request Schema
Response
ReturnsLoginOutput with account and authentication token.
Error Codes
400-AccountOtpInvalid: Invalid or expired OTP404-AccountNotFound: Account not found
Password Reset (Initiate)
POST /api/client/accounts/emails/passwords/reset/init
Request password reset OTP
Request Body
Account email address
Request Schema
Response
OTP verification ID
OTP expiration timestamp
Behavior
- Always returns 200 even if email doesn’t exist (security best practice)
- Sends OTP email if account exists
- OTP expires based on server configuration
Error Codes
429-TooManyRequests: Rate limit exceeded
Password Reset (Complete)
POST /api/client/accounts/emails/passwords/reset/complete
Complete password reset with OTP and new password
Request Body
OTP verification ID
One-time password code
New password (must meet password requirements)
Request Schema
Response
Always
true on successful resetBehavior
- Updates account password
- Logs out all devices for security
- User must log in again with new password
Error Codes
400-AccountOtpInvalid: Invalid or expired OTP400-AccountOtpInvalid: Account registration incomplete
Logout
DELETE /api/client/accounts/logout
Logout current device
Authentication
Requires valid JWT token inAuthorization header.
Response
Returns empty object{}.
Behavior
- Deletes current device from database
- Publishes
device.deletedevent - Invalidates JWT token for this device
Account Sync
POST /api/client/accounts/sync
Sync account data and workspaces
Authentication
Requires valid JWT token inAuthorization header.
Response
Array of workspace objects where user has active role
Response Schema
Behavior
- Updates device metadata (last sync time, IP, platform, version)
- Returns all active workspaces where user role is not
none - Filters out
UserStatus.Removedusers
Error Codes
404-AccountNotFound: Account not found404-DeviceNotFound: Device not found401- Unauthorized: Invalid or expired token