Skip to main content
The CRM API supports three authentication methods. Pick the one that fits your integration.

Authentication methods at a glance

All three methods resolve to a user identity. RBAC rules apply the same way regardless of how you authenticate.

Browser session (cookies)

When a user signs in through the BasicsOS web UI, the server sets session cookies. Any same-origin request from the browser automatically includes these cookies.
No Authorization header is needed. This is the default auth for the built-in web app.

Better Auth session token

Some clients (mobile apps, desktop apps) obtain a session token from Better Auth during login. Pass it as a Bearer token:
The server maps this token to the same session the browser uses internally.

Personal CRM API token

For programmatic access — scripts, server-to-server integrations, CI/CD pipelines — create a Personal CRM API token in the BasicsOS web app under Settings > Personal CRM API tokens.
  • Prefix: bos_crm_
  • Scoping: The token acts as the user who created it. RBAC rules apply exactly as they do in the web UI.
  • Storage: The full token is shown once at creation. Store it securely; it cannot be retrieved again.
Personal CRM API tokens are created in-app, not through the Basics Gateway. They are specific to your self-hosted server.

Token management API

Manage Personal CRM API tokens programmatically. These endpoints require session-based auth (browser cookies or Better Auth session token) — you cannot use a Personal CRM API token to create or revoke other tokens.
Only users with records.write permission (or admins with full access) can manage API tokens.

List active tokens

Returns an array of token metadata. The token secret is never included in list responses.
Response:

Create a token

Request body:
Response:
The token field is returned only in the creation response. Copy and store it immediately.

Revoke a token

Returns 204 No Content on success.

Token management summary