All cf0 API endpoints require authentication. cf0 uses Bearer token authentication — you pass your session JWT in theDocumentation Index
Fetch the complete documentation index at: https://docs.cf0.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header with every request.
Getting your token
cf0 uses short-lived JWTs for authentication. Your session token is issued when you sign in and automatically renewed by the browser.Sign in to cf0
Go to cf0.ai and sign in with your account credentials.
Retrieve the session token
Retrieve a fresh API token programmatically from the cf0 web app via the Clerk SDK:This returns a short-lived JWT scoped to your active organisation. Always call
getToken() immediately before each request rather than caching the result — tokens expire on the order of a minute and Clerk handles refresh automatically.Request header format
Example request
Organisation context
Tokens are scoped to your organisation. The API automatically resolves your organisation from your token — you do not need to pass an org identifier separately. Some endpoints require organisation membership. If your token is not associated with an active organisation, those requests returnHTTP 403 with:
Session verification endpoint
You can verify a token and retrieve the current user’s identity with:Error responses
| Status | Cause |
|---|---|
401 Unauthorized | Token is missing, malformed, or expired |
403 Forbidden | Token is valid but the resource requires organisation membership or admin role |
Token expiry
Clerk session tokens are short-lived (on the order of a minute) and refreshed automatically by the Clerk SDK in the browser. For long-running server-side integrations, callgetToken() immediately before each request rather than caching — caching invites silent 401s.
The POST /api/auth/session endpoint verifies the current token’s freshness if you need to check explicitly.
