Skip to main content
All Causeloop API requests are authenticated with a Bearer JWT in the Authorization header. There are two ways to obtain a token:
  • Human users — exchange an upstream identity provider token for a Causeloop Bearer token via POST /auth/exchange.
  • Machine-to-machine — create a service account and issue it a long-lived bearer token.

The token-exchange flow (AuthBridge)

Causeloop’s frontend authenticates users through WorkOS AuthKit (email/password or Google OAuth). Once WorkOS issues an access token to the browser session, your client exchanges it for a Causeloop-native token via POST /v1/auth/exchange. This is the token you use for all subsequent API calls. The backend’s identity provider is pluggable (AUTH_PROVIDER=workos|auth0|okta|oidc|none) — any configured provider verifies via JWKS the same way; WorkOS is the provider used by the current Causeloop frontend (apps/platform). Exchange is deny-by-default: a verified token only yields a Causeloop JWT if the identity resolves to an existing membership, an accepted invitation, or (only when the workspace has explicitly opted into domain JIT) a verified-domain match. Exchange never creates a user as a side effect of sign-in on any other path — an unprovisioned identity gets a 403 forbidden and an auth.login.denied audit event is written.

Exchange endpoint

Request body
Response

Refreshing a token

When an access token expires, exchange the refresh_token for a new one:
The response has the same shape as the exchange response, with a fresh access_token and a new refresh_token.
Store refresh tokens in HttpOnly, Secure, SameSite=Strict cookies rather than localStorage to mitigate XSS token theft.

Making authenticated requests

Once you have an access token, include it in every request:
A missing or invalid token returns 401 Unauthorized:

Service accounts (machine-to-machine)

For automation pipelines, CI/CD, and backend integrations that cannot run an interactive WorkOS sign-in, use service accounts. Service accounts have their own long-lived bearer tokens with explicit scopes, and do not require user interaction.
Service account endpoints require workspace:admin scope.

Create a service account

Response (201 Created)

Issue a token for a service account

Response (201 Created)
The token value is shown only once at creation time. Store it securely — it cannot be retrieved later. Only a SHA-256 hash is stored by Causeloop.
Use the returned token value as the Authorization: Bearer token in all API calls made by the service account.

Manage service account tokens

Multi-factor authentication (MFA)

Workspace members can enroll TOTP or SMS factors. MFA is managed through: When a workspace enforces MFA, users who have not enrolled will receive a 403 Forbidden with code mfa_required.

Single Sign-On (SSO)

Causeloop supports SAML and OIDC SSO connections for enterprise workspaces (Google, Okta, Azure AD, and custom IdPs). SSO flow endpoints SSO connection management (requires admin)

SCIM provisioning

Causeloop provides a SCIM 2.0 endpoint for automated user and group provisioning from identity providers like Okta and Azure AD. Base URL: https://api.causeloop.ai/scim/v2/{tenant} Authentication uses a dedicated SCIM bearer token (not a user token). Create and manage SCIM tokens: SCIM resource endpoints
SCIM tokens are stored as SHA-256 hashes. The plaintext value is returned only at creation.