Skip to main content
The ChatGrid API supports two authentication methods: API keys (recommended for server-to-server) and Supabase JWTs (used by the web app).

API keys

API keys are the recommended way to authenticate. They start with the cgk_ 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 (requires admin scope):
The full key is returned only once in the 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_at is tracked for auditing.

Scopes

Each API key has one or more scopes that control what it can access: If a request requires a scope your key does not have, you receive a 403 Forbidden:

Scope requirements by endpoint

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:
JWT-authenticated requests automatically have read, write, and admin scopes. Rate limits differ from API key limits (200 req/min for JWTs).

Error responses