Authentication
The Maison API supports two authentication methods. Choose the one that fits your integration type.
Bearer Token (Session Auth)
Used by: chat widget, business console, and any browser-based application where a user signs in directly.
How it works
- Sign in via
POST /auth/loginwith your email and password. - A session cookie is set automatically. It is scoped to
.maison-labs.comand is shared across all subdomains. - Subsequent requests carry the cookie automatically in browser environments.
You can also send the token explicitly as an Authorization header instead of a cookie:
Check session validity
Call GET /auth/ to verify whether the current session is valid:
API Key
Used by: external integrations, A2A agents, MCP clients, and server-to-server calls.
Key format
Keys follow the pattern mx_{env}_{base64url_payload}. For example: mx_p_UER3NVky... where the middle segment identifies the environment. Send the key in the x-api-key request header.
Create an API key
Key creation requires an active session — you must be signed in. Call PUT /api/user/apikey:
Send requests with an API key
Always pair the API key with the x-client-id header for client-scoped operations:
Revoke a key
Delete a key by its ID using DELETE /api/user/apikey/:id. Deletion is immediate and permanent.