> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload File

> Start a file upload; Memanto turns the file into memories.

## Overview

Uploading takes three steps:

1. Call this endpoint with the file's name. It returns a signed `upload_url` (valid for 15 minutes) and a `job_id`.
2. `PUT` the file's bytes to `upload_url` with the returned `content_type` as the `Content-Type` header. No API key on this request.
3. Poll [Get File Job](https://docs.memanto.ai/cloud/api/files/get-file-job.md) until `status` is `complete` (or `failed`).

Supported types: `.pdf`, `.docx`, `.xlsx`, `.json`, `.txt`, `.csv` and `.md`.

## Authentication

**x-api-key** `string` *required*

Your Memanto Cloud API key (`mk_...`). See [Authentication](https://docs.memanto.ai/cloud/api/introduction.md#authentication).

## Path Parameters

**agent\_id** `string` *required*

The agent's ID.

## Body

**file\_name** `string` *required*

The file's name, with its extension.

**size\_bytes** `integer`

The file's size.

**tags** `array`

Up to 20 tags.

Then upload the bytes:

```bash theme={null}
curl -X PUT "$UPLOAD_URL" -H "Content-Type: application/pdf" --data-binary @handbook.pdf
```

```bash cURL theme={null}
curl -X POST "https://api.memanto.ai/agents/my-agent/files" \
  -H "x-api-key: $MEMANTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_name": "handbook.pdf",
    "size_bytes": 482133
  }'
```

```json 202 - Accepted theme={null}
{
  "agent_id": "my-agent",
  "file_id": "file_…",
  "job_id": "job_…",
  "file_name": "handbook.pdf",
  "content_type": "application/pdf",
  "status": "queued",
  "tags": [],
  "upload_url": "https://storage.googleapis.com/…",
  "storage_key": "…",
  "method": "PUT",
  "expires_in_seconds": 900,
  "hint": "Upload with PUT <upload_url>, header Content-Type: application/pdf, body = file bytes. Then poll GET .../file-jobs/job_…."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.