Get started/3 of 22
Authentication
User JWTs, Business mq_live_ API keys, and where each mode is required.
| Mode | Header |
|---|---|
| User session | Bearer Supabase access token |
| API key (Business) | Bearer mq_live_… or X-Api-Key |
Create keys with POST /api/v1/workspaces/:id/api-keys (user JWT, admin+, Business — features.apiKeys). Free/Pro get plan_forbidden. Optional body:
json
{ "name": "CI", "scopes": ["generate", "dynamic", "bulk"] }Billing, domains, API-key admin, teams, campaigns, and /me require a user JWT. Scoped API keys cover generate, dynamic, bulk, projects, and analytics once issued.
Keep keys on the server only — never in browser or mobile app code. Revoke and rotate if a key leaks.
headers
# User session (any plan)
Authorization: Bearer <supabase_access_token>
# API key — Business plan only (either form)
Authorization: Bearer mq_live_…
X-Api-Key: mq_live_…