Skip to content
QwryAI
Documentation
Pages

Endpoints

List sources

List an agent's sources with their type, version and training state, 20 per page

list_sources returns the sources on the agent's Data sources page, newest first, without their content. Each row carries the version you send back when you edit, delete or train the source. Filter by name with search or by source type with type; to filter by status, use find_sources_by_status (below).

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

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.
pageintegerYesThe page to return, from 1 to 10000. Each page holds 20 sources.
searchstringNoReturn only sources whose name contains this text. Up to 200 characters.
typestringNoOne source type: url (Website), text (Plain Text), qa (Q&A Pairs), file, csv, excel or notion. Leave it out to list every type.

Request example

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

Response

JSON
{
  "success": true,
  "data": {
    "items": [
      {
        "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
      },
      {
        "id": "<sourceId>",
        "name": "Returns FAQ",
        "type": "qa",
        "version": 2,
        "desiredLifecycle": "pending_deletion",
        "processingState": "idle",
        "publicationState": "removal_pending",
        "publishedCount": 1,
        "health": "healthy",
        "warning": null,
        "operation": { "status": "succeeded", "phase": "deletion_pending_publication", "progress": 100 },
        "pendingChanges": true,
        "updatedAt": "2026-11-26T11:24:29.795Z",
        "autoRetrain": false
      }
    ],
    "pagination": { "page": 1, "limit": 20, "total": 2, "pages": 1 }
  }
}
FieldTypeDescription
idstringThe source's id. Pass it as sourceId to the other source tools.
namestringThe name on the Data sources page.
typestringurl, text, qa, file, csv, excel or notion.
versionintegerGoes up with every change. Send it as expectedVersion when you edit, delete, restore or train the source.
desiredLifecyclestringactive, or pending_deletion once deleted and waiting for training.
processingStatestringidle, queued, running or cancelling.
publicationStatestringnever_published (not trained), changed (edited since training), published (trained) or removal_pending.
publishedCountintegerHow many of its documents the agent answers from now.
healthstringhealthy, warning or error.
warningobjectThe last warning's code and message, or null.
operationobjectThe latest fetch or training run: status, phase and progress (0 to 100), or null.
pendingChangesbooleantrue when the source has changes the agent isn't using yet.
updatedAtstringWhen the source last changed, in ISO 8601.
autoRetrainbooleanWhether a website retrains every week.
paginationobjectpage, limit (always 20), total and pages. Read on while page is less than pages. See Pagination.

Filter by status

find_sources_by_status takes statuses (one or more of new, changed, training, trained, failed, removed and partly_trained) and page, and returns the same rows with the status the Data sources page shows, failing ones first. Its page details are page, total and hasMore. See Source status.

Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/find_sources_by_status' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"chatbotId": "YOUR_AGENT_ID", "statuses": ["failed"], "page": 1}'

Errors

HTTP statuscodewhen
400INVALID_ARGUMENTSpage is missing or out of range, type isn't a listed value, or search is over 200 characters. issues names each one.
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.
413RESULT_TOO_LARGEThe page is over 40,000 bytes. Narrow it with search or type.
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