Upload a document (PDF, DOCX, PPTX, CSV, XLS/XLSX, TXT, Markdown, HTML, or JSON; 10 MB max) as a file training source and queue background indexing. Send the document as a file field in a multipart/form-data body. Poll GET /agents/{id}/sources or GET /agents/{id}/training-status to watch progress. Requires the write:sources permission.
Authorization
BearerAuth write:sourcesIn: header
Scope: write:sources
Path Parameters
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/agents/string/sources/files" \ -F file="string"{
"id": 0,
"agentId": "string",
"type": "file",
"name": "string",
"status": "processing"
}{
"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"
}
]
}{
"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"
}
]
}Delete a training source DELETE
Remove a source and everything indexed from it. This cannot be undone. Requires the `write:sources` permission.
Get training status GET
Live training state for an agent: whether a run is active, its phase, and page progress. Poll this after adding sources or triggering a retrain. Requires the `read:sources` permission.