API overview
The AskAnyDocs external API lets teams retrieve account, bot, conversation, and message data using bearer API keys. Start here to understand the base path, endpoint categories, authentication model, status codes, and current read-only scope.
The AskAnyDocs API reference covers the external team API protected by bearer API keys. It is designed for integrations that need to retrieve bot metadata, account usage, conversations, and message history for the team connected to an API token.
External API scope
The external API is read-only today. It is intended for reporting, analytics, internal dashboards, data export, and downstream workflows that need to inspect existing AskAnyDocs data.
It is not currently intended for public browser-side use or for managing knowledge sources from third-party applications. Keep API keys on the server side.
Base path
All external API endpoints use this base path:
/api/external
In production, combine the base path with the AskAnyDocs application domain:
https://app.askanydocs.com/api/external
Current endpoints
Current external endpoints include:
GET /api/external/account/statsGET /api/external/account/planGET /api/external/botsGET /api/external/bots/{id}/statsGET /api/external/bots/{id}/conversationsGET /api/external/bots/{id}/conversations/{conversationId}GET /api/external/bots/{id}/messagesGET /api/external/bots/{id}/messages/{questionId}
Use the bots endpoint first to discover bot IDs, then request stats, conversations, or messages for the bot you want to analyze.
Endpoint categories
Account endpoints
Use account endpoints to retrieve workspace-level information for the team connected to the API token:
- current usage and totals
- current plan and subscription state
- plan limits and enabled features
- team-level counts for bots, resources, chunks, messages, conversations, and members
These endpoints are useful for internal dashboards and usage reporting.
Bot endpoints
Use bot endpoints to retrieve:
- bot metadata
- bot-level usage totals
- conversation lists and conversation details
- message lists and message details
Bot endpoints are useful for analytics, support review, quality monitoring, and exporting conversation history into another internal system.
Authentication model
The external API uses bearer-token authentication:
Authorization: Bearer YOUR_API_TOKEN
The token belongs to a team. After authentication, responses are scoped to that team. A token cannot read data from another workspace.
Do not expose API tokens in browser code, frontend bundles, or public repositories. Use them only from trusted server-side environments.
Response format
The external JSON APIs return standard JSON objects and arrays. For collection endpoints, the current shape is:
{
"items": []
}
Use normal HTTP status codes to detect authentication errors, missing bots, and successful responses.
Common HTTP status codes
| Status | Meaning |
|---|---|
200 |
Request completed successfully |
401 |
Missing or invalid bearer token |
404 |
Bot, conversation, or message not found |
Recommended integration pattern
A typical integration uses the API like this:
- Store the API token securely on your server.
- Request account stats or plan data for workspace reporting.
- List bots to find the bot IDs you need.
- Pull conversations or messages on a schedule.
- Store only the data your downstream workflow actually needs.
Before you build
Start with API authentication, then use the bots endpoint to discover available bot IDs. If your goal is to add sources, upload files, or trigger indexing, use the dashboard rather than the external API, because knowledge-source management is outside the public bearer-token API boundary today.
Related articles
API authentication
AskAnyDocs external API requests require a bearer API key in the Authorization header. Learn how tokens are generated, how team scoping works, how to test a request, and how to keep API keys secure.
External bots, conversations, and messages API
This API reference explains the read-only bot, conversation, and message endpoints available through the AskAnyDocs external team API, including request examples, response shapes, and integration use cases.
Knowledge sources API
Knowledge-source management is not part of the public external API today. This guide explains the current boundary, what integrations can read, and how to manage website pages, sitemaps, URL lists, and files through the dashboard.