Skip to Content
Getting StartedAuthentication

Authentication

ChatBlocks supports two authentication methods for the main API surface. Both work with page and page-job endpoints.

API keys are bearer tokens prefixed with cb_live_. Pass them in the Authorization header:

curl -X GET https://chatblocks.app/api/pages \ -H "Authorization: Bearer cb_live_YOUR_KEY"

Managing keys

  • Create: Go to Settings or POST /api/keys (session auth required)
  • List: GET /api/keys (session auth required)
  • Revoke: DELETE /api/keys/:id (session auth required)

Key properties

PropertyDescription
Prefixcb_live_
StorageSHA-256 hash stored in database
DisplayFull key shown once on creation, only prefix shown after
RevocationSoft-delete via revoked_at timestamp

Note: API key management endpoints (/api/keys) require browser session auth, not API key auth.

Agent Connect Tokens

Agent connect tokens are not API credentials. They are short-lived shared secrets that let a signed-in user attach an agent instance to their account through the web UI.

Use this flow when your agent needs an account-linking handshake:

  1. Generate a token in Settings
  2. Paste that token into your agent
  3. Open the connect link while signed in
  4. Poll POST /api/agent/token until the token is claimed

See the full Agent Connect guide for the exact flow and example requests.

Browser Session (web)

When using ChatBlocks through the web dashboard, authentication is handled automatically via browser session cookies. The same session works for API calls made from the browser.

This is used internally by the dashboard and is the only method accepted for key management endpoints.

Public endpoints

These endpoints require no authentication:

EndpointDescription
GET /api/qr/:username/:slugGenerate QR code PNG
GET /api/schemaGet page spec JSON Schema
GET /:username/:slugView a published page
GET /:usernameView a user’s default page
Last updated on