Authorization: Bearer <token> header.
- Personal Access Tokens (Recommended)
- JWT Authentication
PATs are long-lived tokens for programmatic API access. They are the recommended method for integrations, scripts, CI/CD pipelines, and any non-interactive usage.Token format: Advantages:
cmnd_<tokenId>.<secret>- Long-lived (up to 365 days)
- Fine-grained scopes limit access to only what’s needed
- Can be rotated without downtime
- No refresh flow required
JWT Authentication Flow
Login
POST /v1/auth/login
LDAP/AD routing: If the user’s email domain matches an IdP configuration, the login request is automatically routed to the configured LDAP/AD directory for authentication. No client-side changes are needed.
SSO Login (Microsoft Entra ID)
POST /v1/auth/sso
Refresh Token
POST /v1/auth/refresh
Logout
POST /v1/auth/logout
Get Current User
GET /v1/auth/me
currentTenantId— the tenant this session (or PAT) is currently scoped to.groupMemberships[]— every tenant the user belongs to. Read directly from the database, so a PAT (which is bound to one tenant) still returns the full list.
Multi-tenant Sessions
A user may belong to more than one tenant (workspace). An interactive JWT session can be switched between the user’s tenants; each switch mints a fresh token pair scoped to the target tenant.PATs cannot be switched — a PAT is bound to a single tenant at issuance. To operate against another tenant, mint a new PAT under that tenant. See API Tokens → Tenant scope.
Switch Tenant
POST /v1/auth/switch-tenant
tenant_idmay be a sub-organization id; the server normalizes it to the tenant root for isolation. Sub-organizations remain addressable by their own id on endpoints that take one.- Membership is verified — the caller must be a member of the target tenant. System administrators may switch into any tenant (recorded as an override in the audit log).
- Rate-limited per user; do not switch in tight loops.
Full flow — list tenants, then switch
1
Log in
2
List memberships and see the active tenant
currentTenantId is null, the session has not yet picked an active tenant — pick one in the next step.3
Switch to a chosen tenant
4
Confirm the switch landed
Registration & Password Reset
Registration Flow
1
Check Registration
2
Register
3
Confirm Email
Password Reset Flow
1
Request Reset
2
Execute Reset
Authentication Endpoints Reference
Security Best Practices
Use PATs for integrations
Use PATs for integrations
PATs are long-lived and scoped — much better than JWTs for automated workflows. Reserve JWTs for interactive sessions.
Always use HTTPS
Always use HTTPS
Never send tokens over HTTP. All production deployments should enforce TLS.
Store secrets securely
Store secrets securely
Use environment variables or secret managers (AWS Secrets Manager, HashiCorp Vault) — never commit tokens to source control.
Use minimal scopes
Use minimal scopes
Only request the permissions you need. A read-only integration should not have
write scopes.Rotate tokens periodically
Rotate tokens periodically
Use the
POST /v1/api-tokens/{id}/rotate endpoint for seamless rotation without downtime.Revoke unused tokens
Revoke unused tokens
Delete tokens that are no longer needed using
DELETE /v1/api-tokens/{id}.Never commit tokens to source control
Never commit tokens to source control
Use
.env files, CI/CD secrets, or secret managers instead.
