Documentation Index
Fetch the complete documentation index at: https://docs.msgflash.com/llms.txt
Use this file to discover all available pages before exploring further.
Scope
This page documents authentication for the web console: It does not apply to the public APIx-api-key flow.
Team workspace header (optional)
After login,Authorization: Bearer <jwt> identifies the user. For resource routes under /api/* (for example /api/messages, /api/contacts, /api/campaigns, /api/instances, /api/templates, /api/webhooks, /api/statuses, /api/media, /api/number-lookups), you may add:
- With
X-Team-Id: requests run in that team’s shared workspace (you must be an active member). - Without it: requests use your personal workspace.
/api/auth/* ignore this header. Team admin routes under /api/teams are separate; see Teams & workspaces and Team context.
Endpoints used by the console
| Method | Endpoint | Usage |
|---|---|---|
POST | /api/auth/signup | Create an account |
POST | /api/auth/login | Open a session |
GET | /api/auth/google | Start Google OAuth |
POST | /api/auth/resend-verification | Resend the verification email |
GET | /api/auth/verify-email/validate?token=... | Check a verification token |
POST | /api/auth/verify-email | Confirm email verification |
POST | /api/auth/forgot-password | Request a reset link |
GET | /api/auth/reset-password/validate?token=... | Validate a reset token |
POST | /api/auth/reset-password | Set a new password |
Email signup
POST /api/auth/signup no longer signs the user in automatically.
Expected response:
- account created
- “Check your email” screen
- resend link available
- return to the login page
Email login
POST /api/auth/login always returns a JWT if login succeeds.
Important business cases:
| Code | UI meaning |
|---|---|
UNAUTHORIZED | wrong email or password |
EMAIL_NOT_VERIFIED | show a clear message and offer to resend the email |
EMAIL_NOT_VERIFIED:
Google OAuth
Flow:- the console opens
GET /api/auth/google - the backend redirects to Google
- Google returns to
https://app.msgflash.com/auth/callback - the JWT is read from
?token=... - the console stores the JWT and redirects to
/dashboard
?error=oauth_failed, the console sends the user back to /login?error=oauth_failed.
Email verification
Relevant page:- read the token
- call
GET /api/auth/verify-email/validate?token=... - if valid, call
POST /api/auth/verify-email - show the result without auto-login
validexpiredusedinvalidalready_verified
/login.
Forgot password
Flow:/forgot-passwordformPOST /api/auth/forgot-password- email with reset link
/reset-password?token=...- validate token
POST /api/auth/reset-password- return to
/login
Important UX notes
- Classic signup does not open a session automatically.
- Email verification is mandatory before login.
- The “Resend verification email” button should stay available on:
- the screen shown after signup
- the login screen when
EMAIL_NOT_VERIFIEDis returned - the
/verify-emailpage when the token is expired or invalid