Skip to content

API reference

Authentication

View as Markdown

Every request to https://api.chat-data.com/api/v2 carries an API key as a Bearer token in the Authorization header.

export CHAT_DATA_API_KEY='<your full API key>'curl https://api.chat-data.com/api/v2/get-chatbots -H "Authorization: Bearer $CHAT_DATA_API_KEY"

New to Chat Data? Sign in or create an account, then create a key in Workspace settings → API keys.

Two kinds of keys

KeyReachesCreate it in
Workspace keyEvery chatbot and resource in the workspaceWorkspace settings → API keys in your dashboard (Owner or Admin)
Chatbot-scoped keyOnly the chatbot it was created forThe chatbot's Settings → API keys page (Full or Admin access)

Create and train a chatbot, Get the current plan and the sub-user operations need a workspace key. A chatbot-scoped key gets 403 with "This operation requires a user-level API key, not a chatbot-specific key" on those. Get all chatbots works with either key; a chatbot-scoped key gets just its own chatbot.

Keys are shown in full only once, when you create them. After that Chat Data, including these docs, only shows a masked form such as sk-...a91f.

Keep keys on your server

An API key acts with full authority over what it reaches. Call the API from your backend and read the key from an environment variable; never put it in browser or mobile code. The code samples on every page read CHAT_DATA_API_KEY for that reason.

Authentication errors

StatusMessageFix
401Authorization header is missingSend Authorization: Bearer <key>.
401Invalid Authorization header formatThe header must be exactly Bearer, one space, then the key.
401Unauthenticated RequestThe key does not exist or was deleted.
401API key workspace is unavailable or has been deleted.The key's workspace no longer exists; create a key in a current workspace.
401API key workspace has no owner.Contact support: the workspace needs an owner before its keys work.
401API access isn't included in your workspace's current planSee plans.
403This operation requires a user-level API key, not a chatbot-specific keyUse a workspace key for this operation.

Last updated October 14, 2026