API docs

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.

Last updated: 2026-05-31

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/stats
  • GET /api/external/account/plan
  • GET /api/external/bots
  • GET /api/external/bots/{id}/stats
  • GET /api/external/bots/{id}/conversations
  • GET /api/external/bots/{id}/conversations/{conversationId}
  • GET /api/external/bots/{id}/messages
  • GET /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

A typical integration uses the API like this:

  1. Store the API token securely on your server.
  2. Request account stats or plan data for workspace reporting.
  3. List bots to find the bot IDs you need.
  4. Pull conversations or messages on a schedule.
  5. 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