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": ""
}
{
"detail": "File type '.exe' is not supported. Allowed types: .csv, .docx, .json, .md, .pdf, .txt, .xlsx"
}
{
"detail": "Missing session token. Use X-Session-Token header."
}
{
"detail": {
"error": "SessionExpired",
"message": "Session has expired",
"details": {}
}
}
{
"detail": [
{
"type": "missing",
"loc": ["body", "file"],
"msg": "Field required",
"input": {}
}
]
}
{
"detail": {
"error": "file_too_large",
"message": "File exceeds the maximum upload size of 5 GB",
"max_bytes": 5368709120
}
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "Session is for agent 'other-agent', cannot access 'my-agent'"
}
}
}
Data
Upload File
Upload a document to be processed and stored in the agent’s session namespace.
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": ""
}
{
"detail": "File type '.exe' is not supported. Allowed types: .csv, .docx, .json, .md, .pdf, .txt, .xlsx"
}
{
"detail": "Missing session token. Use X-Session-Token header."
}
{
"detail": {
"error": "SessionExpired",
"message": "Session has expired",
"details": {}
}
}
{
"detail": [
{
"type": "missing",
"loc": ["body", "file"],
"msg": "Field required",
"input": {}
}
]
}
{
"detail": {
"error": "file_too_large",
"message": "File exceeds the maximum upload size of 5 GB",
"max_bytes": 5368709120
}
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "Session is for agent 'other-agent', cannot access 'my-agent'"
}
}
}
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. Files are streamed to disk in 1 MB chunks and hard-capped at 5 GB; anything larger is rejected mid-upload with 413.Authentication
API clients do not send an API key orAuthorization header.
string
required
Session token from Activate Agent. Must match
agent_id.-F, do not set Content-Type manually — curl sets multipart/form-data with the correct boundary.
Path Parameters
string
required
The unique identifier of the agent.
Body (multipart)
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": ""
}
{
"detail": "File type '.exe' is not supported. Allowed types: .csv, .docx, .json, .md, .pdf, .txt, .xlsx"
}
{
"detail": "Missing session token. Use X-Session-Token header."
}
{
"detail": {
"error": "SessionExpired",
"message": "Session has expired",
"details": {}
}
}
{
"detail": [
{
"type": "missing",
"loc": ["body", "file"],
"msg": "Field required",
"input": {}
}
]
}
{
"detail": {
"error": "file_too_large",
"message": "File exceeds the maximum upload size of 5 GB",
"max_bytes": 5368709120
}
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "Session is for agent 'other-agent', cannot access 'my-agent'"
}
}
}