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

> ## Agent Instructions
> Follow the content contract in AGENTS.md.
> Treat text as the canonical explanation; video and screenshots enhance it.
> Do not publish unverified product behavior or duplicate an existing canonical article.

# Attachments

> Upload files to an Agent Run with multipart form data.

Use `multipart/form-data` on `POST /api/developers/v1/runs` when StefanBrain must read files with the message.

* Put the JSON request body in a `payload` field.
* Add each upload as a `files` field.
* The maximum is 10 files for each run. Each file can be up to 100 MB.
* Supported uploads include images, PDFs, common Office documents, spreadsheets, and text files.
* Audio and video files are rejected. Host the media and put its public URL in the run's `message` instead.

```bash theme={"system"}
curl -X POST https://stefanbrain.com/api/developers/v1/runs \
  -H "Authorization: Bearer stefan_sk_your_key_here" \
  -F 'payload={
    "message":"Summarize the attached deck and give me three CTA options.",
    "sync": true
  }' \
  -F "files=@/absolute/path/to/deck.pdf"
```

Use uploaded `files` only. Internal attachment ids and referenced document ids are not part of the public API.

## Handle upload errors

* `400 too_many_attachments`: send 10 files or fewer.
* `400 unsupported_attachment`: the file type is not supported, or the file is audio or video.
* `400 invalid_multipart` or `invalid_json`: rebuild the multipart body with a valid JSON `payload` field.
* `413 attachment_too_large`: a file is over 100 MB, or the whole request is too large.


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