Skip to main content
POST
/
api
/
v2
/
agents
/
{agent_id}
/
upload-file
curl -X POST "http://localhost:8000/api/v2/agents/my-agent/upload-file" \
  -H "X-Session-Token: your_session_token" \
  -F "file=@report.pdf"
{
  "agent_id": "my-agent",
  "session_id": "session_abc123",
  "namespace": "memanto_agent_my-agent",
  "file_name": "quarterly-report.pdf",
  "file_size": 2516582,
  "status": "uploaded",
  "message": ""
}

Overview

Uploads a file into the agent’s Moorcheh namespace for the active session. Moorcheh extracts text and indexes it so content can be discovered via Recall.
Supported extensions: .pdf, .docx, .xlsx, .json, .txt, .csv, .md. The route validates the extension before upload; size limits follow Moorcheh / server configuration (large uploads may take time).

Authentication

API clients do not send an API key or Authorization header.
X-Session-Token
string
required
Session token from Activate Agent. Must match agent_id.
When using curl with -F, do not set Content-Type manually — curl sets multipart/form-data with the correct boundary.

Path Parameters

agent_id
string
required
The unique identifier of the agent.

Body (multipart)

file
file
required
File field name must be file (FastAPI UploadFile parameter).
curl -X POST "http://localhost:8000/api/v2/agents/my-agent/upload-file" \
  -H "X-Session-Token: your_session_token" \
  -F "file=@report.pdf"
{
  "agent_id": "my-agent",
  "session_id": "session_abc123",
  "namespace": "memanto_agent_my-agent",
  "file_name": "quarterly-report.pdf",
  "file_size": 2516582,
  "status": "uploaded",
  "message": ""
}

Next Steps

  • Recall to search across uploaded content
  • Remember to add structured memories alongside uploads