List sources

GET/v2/agents/{agentId}/sources

Return the sources of an agent with their type, title, training status and size, filtered by type or status and split into pages.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

Returns a page of the sources of one agent, newest first. Call it to see what the agent knows, to find sources that failed training, or to build a view of the knowledge base in your own tool.

Request

GET /v2/agents/{agentId}/sources

Path parameters:

Name Type Required Description
agentId string Yes The ID of the agent, starting with agt_.

Query parameters:

Name Type Required Description
limit integer No Items per page, from 1 to 100. Defaults to 20.
cursor string No The nextCursor value from the previous page.
type string No Only sources of this type: website, file, text or qa.
status string No Only sources with this status: queued, training, ready or failed.

The source object and its statuses are described in the Sources API overview. For counts instead of a list, use Get sources summary.

Example request

curl "https://api.askocto.co/v2/agents/agt_8f3k2m/sources?status=failed" \
  -H "Authorization: Bearer $OCTO_API_KEY"
const url = new URL("https://api.askocto.co/v2/agents/agt_8f3k2m/sources")
url.searchParams.set("status", "failed")

const response = await fetch(url, {
  headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
})

const { data } = await response.json()
for (const source of data) console.log(source.id, source.title, source.failureReason)

Example response

A successful call returns 200 OK.

{
  "data": [
    {
      "id": "src_4n7c2w",
      "type": "file",
      "title": "Returns policy",
      "status": "failed",
      "characters": 0,
      "failureReason": "The file contains no readable text.",
      "createdAt": "2026-03-19T15:02:00Z"
    },
    {
      "id": "src_2d6m9t",
      "type": "website",
      "title": "Shipping pages",
      "status": "failed",
      "url": "https://example.com/shipping",
      "characters": 0,
      "failureReason": "The address could not be reached.",
      "createdAt": "2026-03-14T09:45:00Z"
    }
  ],
  "nextCursor": null
}

Response fields

Name Type Description
data[].id string The source ID, starting with src_.
data[].type string website, file, text or qa.
data[].title string The name shown in the dashboard and in the sources of a chat reply.
data[].status string queued, training, ready or failed.
data[].url string The crawled address. Only on website sources.
data[].characters integer The size of the content the agent can read.
data[].failureReason string or null Why training failed. null unless the status is failed.
data[].createdAt string An ISO 8601 UTC time.
nextCursor string or null Pass it as cursor for the next page. null on the last page.

List items leave out the long text of text and qa sources. Read a single source with Get source for its full fields.

Errors

Status Code When
400 invalid_request limit is outside 1 to 100, or type or status is not one of the listed values.
401 unauthorized The API key is missing, malformed or deleted.
404 not_found No agent has this ID in your workspace.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

See Pagination for how cursors work.

Something unclear or missing? Tell us and we will fix the page.