Authentication models
1) Chat API authentication (/api/v1/chat/*)
Use Authorization: Bearer <token> where token is one of:
- Tenant JWT (signed with tenant-specific
jwtSecret) - Tenant API key (prefix
ab_...)
userIdtenantIdexpiat
emailpermissions
2) Admin API authentication (/api/v1/admin/*)
Use Authorization: Bearer <supabase_access_token>.
The backend verifies Supabase identity and maps the user to an internal tenant via admin_users.
Header format
Common auth failures
401 Missing or invalid authorization header401 Invalid token401 Token expired403 No tenant linked. Complete onboarding first.