Upload a file source
Upload a document or image (PDF, DOCX, PPTX, CSV, XLS/XLSX, TXT, Markdown, HTML, JSON, PNG, JPEG, WebP, or GIF; 10 MB max) as a file training source and queue background indexing. Send it 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.
Search knowledge GET
Search the agent's trained knowledge base and get the most relevant passages, ordered by relevance, without generating a reply. Runs the same retrieval the agent uses when answering, so it is the fastest way to check what the agent knows about a topic. Does not use message credits. An agent that has not finished training returns an empty list. Requires the `read:knowledge` permission.