Add File
Upload a document file to an agent's knowledge base.
POST
/knowledge/add-fileUpload a file (PDF, DOCX, TXT, etc.) to be processed and added to the knowledge base.
No parameters for this endpoint.
Request
This endpoint uses multipart/form-data for file uploads.
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | The agent's public ID (ag_*) |
file | file | Yes | The file to upload |
Supported Formats
| Format | Extensions | Max Size |
|---|---|---|
.pdf | 50 MB | |
| Word | .docx, .doc | 50 MB |
| Text | .txt | 10 MB |
| Markdown | .md | 10 MB |
| CSV | .csv | 50 MB |
| Excel | .xlsx, .xls | 50 MB |
| JSON | .json | 10 MB |
cURL Example
curl -X POST https://api.thinnest.ai/knowledge/add-file \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "agent_id=ag_c47e7c97_b2f2" \
-F "file=@/path/to/document.pdf"Response 201
{
"id": 3,
"name": "document.pdf",
"type": "file",
"status": "processing",
"created_at": "2026-03-07T14:00:00Z"
}The file is processed asynchronously. Check status via List Sources.
Errors
| Code | Description |
|---|---|
401 | Missing or invalid authentication |
404 | Agent not found |
413 | File too large |
415 | Unsupported file type |