API
Getting your API key#
Open Integrations — reachable from your avatar dropdown in the assistant's input, or your profile dropdown in the admin panel. From there you can view (masked or revealed), copy, or reset your key.
There is one live key per workspace. Resetting immediately revokes the old one — there is no key history, so update any callers before you reset.
Authentication#
Every request is authenticated with a Bearer token — your workspace's API key.
Authorization: Bearer dbk_YOUR_API_KEYKeep your key secret — it grants full access to your workspace's AI chat. Every answer is billed against the same project balance the docs-chat widget spends; there is no separate API-only allowance.
/api/v1/chatAsk a question against your workspace's documentation and get back an answer grounded in your own pages.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
The question to ask
The doc page slug the question is asked from, to exclude it from its own citations
Answer language code; defaults to the workspace's default language
Groups related questions for analytics and webhooks
Page slugs to force into context
curl -X POST https://docsbook.io/api/v1/chat \
-H "Authorization: Bearer dbk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question": "How do I set a custom domain?"}'{
"answer": "You can set a custom domain from the Branding tab...",
"refs": [{ "pagePath": "design/domains", "title": "Custom Domains", "heading": "Setup" }],
"follow_up_questions": ["What SSL certificate is used?", "Can I use a subdomain?"]
}| Status | Meaning |
|---|---|
401 |
Missing or invalid API key |
403 |
AI chat is not enabled for this workspace |
429 |
The project's balance is exhausted |
Related#
- MCP tools reference — the tool surface an agent uses instead of this endpoint
- AI chat — the assistant this endpoint exposes, and how it is configured
- Webhooks — being told when a question goes unanswered, rather than polling for it
- AI usage & cost statistics — what these calls cost and what readers asked