Upload Document
POST /agent/documents/upload
Upload a document for automatic ingestion. The document will be chunked, embedded, and added to the volume's knowledge base.
Supported formats: PDF, TXT, Markdown, CSV, DOCX.
Request​
Content-Type: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
file | File | Yes | Document file (max 20 MB) |
volume_id | string (UUID) | Yes | Target volume |
Response​
{
"document_id": "a1b2c3d4-...",
"filename": "team-handbook.pdf",
"size": 1048576,
"status": "processing"
}
info
Document ingestion is asynchronous. The response returns immediately with status: "processing". Use the List Documents endpoint to check progress.
Example​
curl -X POST https://api.sharedmemory.ai/agent/documents/upload \
-H "Authorization: Bearer sm_agent_..." \
-F "file=@team-handbook.pdf" \
-F "volume_id=a1b2c3d4-..."
Errors​
| Status | Error | Description |
|---|---|---|
| 400 | No file provided | Missing file in form data |
| 400 | volume_id required | Missing volume_id |
| 403 | agent_not_authorized_for_volume | No write access |
| 429 | Too Many Requests | Rate limit exceeded (50/hr) |