Read one training source, including the stored text of a text snippet so it can be edited and sent back. content is null for url and file sources, and while a snippet is still being stored. Requires the read:sources permission.
Authorization
BearerAuth read:sourcesIn: header
Scope: read:sources
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/agents/string/sources/1"{
"id": 42,
"agentId": "a1b2c3d4e5",
"type": "text",
"name": "Refund policy",
"status": "indexed",
"sizeBytes": 1234,
"wordCount": 200,
"errorMessage": null,
"createdAt": "2026-08-01T10:00:00.000Z",
"content": "Refunds are available within 30 days of purchase..."
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}Add a training source POST
Add a URL or text snippet to an agent's knowledge and queue background indexing. Poll `GET /agents/{id}/sources` or `GET /agents/{id}/training-status` to watch progress. Requires the `write:sources` permission.
Update a text source PATCH
Update a text snippet in place: change its title, its content, or both. Omitted fields keep their current values. The old content stops matching and the new content is re-indexed in the background; watch the source `status` until it becomes `indexed`. Only text sources can be updated; refresh url sources by retraining and file sources by uploading a new file. Requires the `write:sources` permission.