---
title: "Upload File"
method: POST
path: "/api/v2/agents/{agent_id}/upload-file"
tags: ["Sessions & Agents", "Memory Operations"]
---

# Upload File

`POST /api/v2/agents/{agent_id}/upload-file`

Upload a file directly to the agent's memory namespace (Session-based)

Supported formats: .pdf, .docx, .xlsx, .json, .txt, .csv, .md
Maximum file size: 5GB

The file is processed by Moorcheh to extract text and generate embeddings,
making its content searchable via recall.

Requires:
- X-Session-Token: {session_token}
- Content-Type: multipart/form-data

## Path parameters

- `agent_id` string, required

## Headers

- `x-session-token` string, nullable

## Cookies

- `memanto_session_token` string, nullable

## Response `200`

Successful Response

- UploadFileResponse
  - `agent_id` string, required
  - `session_id` string, required
  - `namespace` string, required
  - `file_name` string, required
  - `file_size` integer, nullable
  - `status` string, required
  - `message` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/moorcheh-ai/apis/memanto-memory-that-ai-agents-love.md) · [All operations](https://skmtc.net/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/moorcheh-ai/memanto-memory-that-ai-agents-love/revisions/f8fc41287ced/schema)
