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

# Upload a File

> Upload a file of any size, then ingest it

## Overview

Uploads a file's raw bytes. The returned `object_uri` is what you pass to [Ingest File](https://docs.personal.ai/composer_apis/endpoint/ingest-file.md) as `uri`, or to [Chat (Streaming)](https://docs.personal.ai/composer_apis/chat-streaming.md) as an attachment's `image`.

There's no size limit on this route. For small files, you can skip it and send the file to Ingest File inline as `content_b64`.

> [!NOTE]
>
> Requires a key that isn't read-only. Member keys can't upload.

## Authorization

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

Your Composer API key

## Path

**filename** `string` *required*

The file's name, such as `menu.pdf`.

## Body

The file's raw bytes.

***

## Response

**object\_uri** `string`

Where the file is stored. Pass it to Ingest File as `uri`.

**bytes** `integer`

The file's size.

***

## Example cURL

```bash cURL theme={null}
curl --request PUT 'https://composer.personal.ai/lab/api/v1/blob/menu.pdf' \
--header 'x-api-key: <your-api-key>' \
--data-binary '@menu.pdf'
```

Then ingest it:

```bash cURL theme={null}
curl --request POST 'https://composer.personal.ai/lab/api/v1/op/ingest.file' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-api-key>' \
--data '{"uri": "<object_uri>", "filename": "menu.pdf", "agent": "my-assistant", "mode": "deep"}'
```

***

## Error Codes

| Code | Description |
| - | - |
| 401 | Missing or invalid API key |
| 403 | This key can't upload (read-only or member key) |


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