Skip to main content

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

FieldTypeRequiredDescription
fileFileYesDocument file (max 20 MB)
volume_idstring (UUID)YesTarget 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​

StatusErrorDescription
400No file providedMissing file in form data
400volume_id requiredMissing volume_id
403agent_not_authorized_for_volumeNo write access
429Too Many RequestsRate limit exceeded (50/hr)