Skip to content
QwryAI
Documentation
Pages

Endpoints

Get source

Read one source's training state, then its documents and their full text

check_training_status returns one source as list_sources shows it: its version, training state, health and the latest fetch or training run. Use it to follow a source after you train it. To read what's inside the source, get_source_content lists its documents with short excerpts and read_source_document returns one document's full text.

POSThttps://api.qwryai.com/public/v1/tools/check_training_status

Authentication

Send your API key as Authorization: Bearer YOUR_API_KEY; it needs the Read agent settings permission. See Authentication.

Body parameters

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from list_agents.
sourceIdstringYesThe source's id, from list_sources.

Reading the content

ToolArgumentsReturns
get_source_contentchatbotId, sourceId, page (from 1)The source's documents, 10 per page: id, title, contentType, a 1,000-character excerpt and truncated. mayHaveMore is true while there may be another page.
read_source_documentchatbotId, sourceId, documentId, offset, and expectedHash after the first callUp to 8,000 characters of one document from offset, with its title, contentType, questions (Q&A only), contentHash and nextOffset. Start at 0; send the nextOffset and contentHash you got until nextOffset is null.

Request example

Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/check_training_status' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"chatbotId": "YOUR_AGENT_ID", "sourceId": "SOURCE_ID"}'

Response

check_training_status:

JSON
{
  "success": true,
  "data": {
    "id": "<sourceId>",
    "name": "Shipping to Canada",
    "type": "qa",
    "version": 1,
    "desiredLifecycle": "active",
    "processingState": "idle",
    "publicationState": "never_published",
    "publishedCount": 0,
    "health": "healthy",
    "warning": null,
    "operation": { "status": "succeeded", "phase": "completed", "progress": 100 },
    "pendingChanges": true,
    "updatedAt": "2026-11-29T10:37:16.040Z",
    "autoRetrain": false
  }
}

The fields are the same as in List sources. A source is live when publicationState is published and pendingChanges is false.

get_source_content:

JSON
{
  "success": true,
  "data": {
    "sourceId": "<sourceId>",
    "page": 1,
    "mayHaveMore": false,
    "documents": [
      {
        "id": "<documentId>",
        "title": "Do you ship to Canada?",
        "contentType": "qa",
        "excerpt": "Yes, orders to Canada arrive in 5 to 7 business days.",
        "truncated": false
      }
    ]
  }
}

Errors

HTTP statuscodewhen
400INVALID_ARGUMENTSsourceId or documentId isn't a valid id, or page or offset is out of range.
400CHATBOT_ID_REQUIREDchatbotId is missing or isn't a valid agent id.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Read agent settings.
404CHATBOT_NOT_FOUNDNo agent with that chatbotId in your workspace.
404SOURCE_NOT_FOUNDThe agent has no source with that id, or the source has no document with that documentId.
409SOURCE_VERSION_CONFLICTread_source_document: the document changed since your first page, or expectedHash is missing after offset 0. Start again at 0.
413RESULT_TOO_LARGEThe answer is over 40,000 bytes.
429INTEGRATION_RATE_LIMIT_EXCEEDEDMore than 2,000 requests in 15 minutes for this key.
500TOOL_FAILEDThe tool failed on our side. Try again.

Authentication and plan errors are listed in Error Handling.

Explore the documentation