---
title: "Upload files"
method: POST
path: "/api/v1/files"
tags: ["files"]
---

# Upload files

`POST /api/v1/files`

## Request

- Base URL: `https://api.capy.ai`
- URL: `https://api.capy.ai/api/v1/files`
- Auth: HTTP bearer

## Request body

- UploadFilesRequest
  - `files` object[], required: The files to upload, at least one and at most 250 MB each. The answer's `targets` come back in this order.
    - `name` string, required: The file name shown on the attachment.
    - `mediaType` string, required: The file's media type, such as `image/png` or `video/mp4`, 1-255 printable ASCII characters. The PUT must send it as `Content-Type`.
    - `sizeBytes` integer, required: The file's exact size in bytes. The PUT must send it as `Content-Length`.

## Response `200`

FileUploadTargets

- FileUploadTargetsEncoded
  - `targets` FileUploadTargetEncoded[], required
    - `fileId` string, required: The upload's id. Attach it to a message by passing it in the send's `files`.
    - `url` string, required: A presigned URL. PUT the file's bytes to it with exactly the declared `Content-Type` and `Content-Length`, and no Authorization header.
    - `expiresAt` string, required

## Other responses

- `401`: capy/Unauthorized
- `403`: capy/Forbidden
- `429`: capy/RateLimited

## Changes

- **2026-10-27** `cdb52fbbee52`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/capy/apis/capy-api/changes/api/v1/files/post.md)

---

[API](https://skmtc.dev/capy/apis/capy-api.md) - [All operations](https://skmtc.dev/capy/apis/capy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/capy/apis/capy-api/revisions/4663f7dc4e39?raw)
