Introduction
Everything you can do in the Docana UI sits on a REST API. This reference documents every endpoint: agents, knowledge, threads, applications, skills, and more. Each endpoint page shows the parameters, the response schema, and a ready-to-copy request in curl, JavaScript, Python, Go, and PHP.
Base URL
All requests go to your deployment's host over HTTPS. For the hosted platform that is:
https://platform.docana.com/api/v1
Authentication
Create an API key first (see Generating API Keys). Send it in the Authorization header using the ApiKey scheme, not as a Bearer token:
Authorization: ApiKey YOUR_API_KEY
Keys have scopes. Full access keys can call every endpoint in this reference. Widget only and Routine only keys are locked to their endpoints, which is what you want for anything that ships to a browser or a third-party system. Manage your keys under API Keys in the platform.
Always Use Trailing Slashes
Every path ends with a slash. A request without one gets a 308 redirect, and most HTTP clients drop the request body when they follow it, so a POST silently loses its payload.
# Good
curl https://platform.docana.com/api/v1/agents/
# Bad: redirects with 308 and your POST body disappears
curl https://platform.docana.com/api/v1/agents
Versioning
/api/v1/ is the canonical, versioned surface and what you should call. The same operations also answer on the versionless /api/ paths, which exist as permanent aliases for the platform's own UI.
Content Type
Send request bodies as JSON with a Content-Type: application/json header. Responses are JSON unless an endpoint says otherwise (for example, the usage report returns a PDF).
Your First Request
List your agents:
curl https://platform.docana.com/api/v1/agents/ \
-H "Authorization: ApiKey $DOCANA_API_KEY"
You get back a JSON array, one entry per agent:
[
{
"id": "cmc4v8xq10001l708h2vxk9d3",
"name": "Support Assistant",
"type": "CUSTOM",
"applicationId": 42
}
]
Every endpoint page in this reference shows the same three things: the parameters, a ready-to-copy request in your language, and the response schema with an example.
OpenAPI Spec
This whole reference is generated from the platform's OpenAPI 3.1 document, and you can use the same file with your own tools:
Import it into Postman or Insomnia to get a ready-made collection, feed it to a code generator for a typed client, or hand it to an AI agent so it can call the API for you.