API keys
API keys are the recommended way to authenticate. They start with thecgk_
prefix and are passed in the Authorization header.
Creating an API key
You can create API keys from the dashboard or via the API itself (requiresadmin scope):
raw_key field. Store it
securely — it cannot be retrieved again.
Key security
- Keys are stored as SHA-256 hashes. ChatGrid never stores your raw key.
- Revoked or expired keys are rejected immediately.
- Each key’s
last_used_atis tracked for auditing.
Scopes
Each API key has one or more scopes that control what it can access:| Scope | Permissions |
|---|---|
read | List and retrieve resources (boards, chats, messages, nodes, etc.) |
write | Create, update, and delete resources. Includes everything in read. |
admin | Manage API keys and access admin-only endpoints. Includes everything in write. |
403 Forbidden:
Scope requirements by endpoint
| Method | Scope required |
|---|---|
GET (list/retrieve) | read |
POST, PATCH, DELETE (mutate) | write |
GET /me/api-keys, POST /me/api-keys, DELETE /me/api-keys/:id | admin |
JWT authentication
The ChatGrid web app authenticates with Supabase JWTs. If you are building a frontend integration, you can pass the user’s Supabase access token:read, write, and admin
scopes. Rate limits differ from API key limits (200 req/min for JWTs).
Error responses
| Status | Code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing or invalid token |
| 401 | unauthorized | API key has been revoked |
| 401 | unauthorized | API key has expired |
| 403 | forbidden | Token lacks the required scope |