Docsbook
Aperçu

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_KEY

Keep 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.

POST/api/v1/chat

Ask a question against your workspace's documentation and get back an answer grounded in your own pages.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Body
questionstringrequired

The question to ask

currentPathstring

The doc page slug the question is asked from, to exclude it from its own citations

langstring

Answer language code; defaults to the workspace's default language

sessionIdstring

Groups related questions for analytics and webhooks

mentionedPagesstring[]

Page slugs to force into context

Example
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?"}'
Response
{
  "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?"]
}
Errors
Status Meaning
401 Missing or invalid API key
403 AI chat is not enabled for this workspace
429 The project's balance is exhausted
  • 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

Updated

Cette page vous a-t-elle été utile ?

Call your documentation's AI chat from your own backend — Docsbook