---
title: "Upload attachment"
method: POST
path: "/attachments"
tags: ["Attachments"]
---

# Upload attachment

`POST /attachments`

## Request

- Base URL: `https://api.caliuapp.com`
- URL: `https://api.caliuapp.com/attachments`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `caliu_session`

Upload a user-owned file attachment. Any file type, max 100MB.

## Response `200`

Idempotent replay - attachment already exists

- object
  - `attachment` Attachment, required
    - `id` string, required
    - `filename` string, required
    - `content_type` string, required
    - `size_bytes` number, required
    - `r2_key` string, required
    - `created_at` string, required

## Other responses

- `201`: File uploaded
- `400`: Invalid file or id
- `402`: Free storage limit reached (Caliu Pro required)
- `409`: id already owned by another user
- `429`: Rate limit exceeded
- `500`: Storage failure

---

[API](https://skmtc.dev/caliuapp/apis/caliu-api.md) · [All operations](https://skmtc.dev/caliuapp/apis/caliu-api/llms.txt) · [OpenAPI document](https://skmtc.dev/caliuapp/apis/caliu-api/revisions/1ba4d3f687fe?raw)
