SupportAiDocs

Authentication

API keys, scopes, rate limits and errors.

The public API lives at https://supportai.co.uk/api/public/v1. Authenticate every request with a workspace API key in the Authorization header.

bash
curl https://supportai.co.uk/api/public/v1/chatbots \
  -H "Authorization: Bearer sk_live_…"

Creating keys #

Go to Settings → API keys. Keys start with sk_live_ and are shown once. They belong to a workspace, not a user, so they keep working when people leave. Revoke a key at any time; revoked keys fail with 401 immediately.

Keep keys server-side
Never ship an API key in a browser or mobile app. For visitor-facing chat use the widget, or proxy the chat endpoint through your own backend.

Scopes #

ScopeGrants
readList chatbots, conversations, messages, leads and source summaries.
writeAdd or replace knowledge sources and trigger reindexing.
chatSend messages to an agent and receive replies.

Rate limits #

120 requests per minute per key. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (unix seconds). Over the limit you get 429 with a Retry-After header. Chat calls also consume message credits from the workspace plan.

Errors #

Errors are JSON with a stable code:

json
{
  "status": 403,
  "code": "FORBIDDEN",
  "message": "This key is missing the \"write\" scope"
}
StatusMeaning
400Validation failed — details lists field errors.
401Missing, malformed or revoked key.
403Scope missing, plan lacks API access, or credits exhausted.
404Resource not in this workspace.
429Rate limited.
5xxSomething broke on our side; safe to retry with backoff.