Team Overview
Roles and listing members
Full Support Flow
End-to-end support setup
Send an invitation
Endpoint:POST /api/v1/tenants/me/invitationsAuth:
Authorization: Bearer <JWT> (OWNER or ADMIN only)Body:
- Roles:
admin|member|agent. You cannot invite as OWNER. - Result: A pending invitation is created with a unique token (valid 7 days). An email is sent to the invitee with an accept link.
- Limit: Only one pending invitation per email per tenant (sending again for the same email returns an error until the first is accepted or revoked).
List and revoke invitations
- List pending:
GET /api/v1/tenants/me/invitations(JWT). Returns pending invitations for the current tenant. - Revoke:
DELETE /api/v1/tenants/me/invitations/:id(JWT). Cancels the invitation.
Accept link in the email
SetFRONTEND_URL (or API_URL) in your .env so the invite email contains the correct accept URL. The link looks like:
{FRONTEND_URL}/invitations/accept?token=...
Invitee opens this in the browser. Your dashboard (or any frontend) should:
- Read the
tokenfrom the query (e.g.?token=...). - Call Get invitation by token:
GET /api/v1/invitations/by-token?token=...(no auth).
Use the response to show: “You’re invited to join as .” - On “Accept,” call Accept invitation (see below).
Accept invitation
Endpoint:POST /api/v1/invitations/acceptAuth: Optional. If the user is logged in (Bearer token) and their email matches the invitation, they join immediately with the invited role. Body (logged-in user):
- New users are created with
email_verified: trueand can log in immediately withPOST /api/v1/auth/loginusing the same email and the password they set.
Login after accepting
- Existing users: Log in as before with
POST /api/v1/auth/login(email + password). - New users (created on accept): Use the same email and the password they set in the accept body; they can log in right after accepting.
API summary
After accept, the user appears in tenant members (
GET /api/v1/tenants/me/members) and can be promoted to agent if needed (POST /api/v1/agents).