Skip to main content
Personal Access Tokens (PATs) are the long-lived credential your scripts, notebooks, CI jobs, and integrations use to call the co-mind.ai API. This page covers why PATs exist alongside the interactive JWT session, which scopes are available, and how to create, rotate, and revoke tokens.
API tokens require a Team or Enterprise plan with API access enabled, and the user must belong to an organization.

Why JWT then PAT

You log in to get a session JWT — a short-lived token (one hour by default) issued from POST /v1/auth/login or an SSO exchange. The JWT is perfect for interactive use, like signing in to the app or exploring the API from a terminal, but it expires and needs refreshing. Not what you want inside a cron job or a customer-facing integration. A Personal Access Token (PAT) is what you mint from that session to hand off to automation. It’s long-lived (up to a year), scope-limited (you pick exactly what it can do), and tied to the workspace your session was scoped to at creation time. The typical flow:
  1. Sign in — receive a session JWT
  2. Choose the workspace you want the token to belong to (if you have more than one, switch to it on the JWT session)
  3. Mint a PAT with the scopes your automation needs
  4. Use the PAT for every API request going forward
  5. Rotate on a schedule; revoke immediately if you suspect compromise
The API Walkthrough walks this end-to-end with real curl calls.

Using a PAT

Include the token in the Authorization header:
Tokens start with the cmnd_ prefix and work anywhere a JWT Bearer token is accepted for the same operations.

Scopes

Scopes are permissions attached to the token — a PAT can only perform operations covered by its scopes. Request only what your automation actually needs; smaller scope means smaller blast radius if the token leaks.
Administrators have additional scopes covering tenant and platform-configuration APIs. Those admin scopes and endpoints are not part of the public reference — see Tenant Admin API and System Admin API for how to request access.

Discover the scopes available to you

The exact scope list your account can request is available via a JWT-authenticated call:
This endpoint requires JWT authentication — PATs cannot access it.

Token management

Management endpoints require JWT authentication. A PAT cannot manage other PATs (a stolen PAT can be used for its scopes, but cannot create new tokens or extend its own lifetime).

Create a token

POST /v1/api-tokens
Response (201):
The token field is returned only once. Store it securely.

List tokens

GET /v1/api-tokens Returns metadata for all your tokens. No secrets are included.

Revoke a token

DELETE /v1/api-tokens/{id} Immediately invalidates the token. This cannot be undone. Idempotent — revoking an already-revoked token returns 204.

Rotate a token

POST /v1/api-tokens/{id}/rotate Revokes the old token and creates a new one with the same name and scopes. The new token inherits the remaining expiry of the old token (capped at 365 days).
Cannot rotate a revoked or expired token.

Limits

Error codes