---
title: "Create upload link"
method: POST
path: "/attachments/uploads"
tags: ["Attachments"]
---

# Create upload link

`POST /attachments/uploads`

## Request

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

Mint a one-time link to upload one file with a plain PUT of its bytes (no multipart, no base64). Single use, valid for an hour, max 100MB.

## Request body

- object
  - `filename` string, required
  - `content_type` string: Defaults to application/octet-stream.

## Response `201`

Upload link created

- UploadLink
  - `upload_url` string, required: PUT the raw file bytes here, with a Content-Length. Single use, expires after an hour.
  - `method` 'PUT', required
  - `attachment_id` string, required
  - `download_url` string, required: Where the file will be, for note markdown.
  - `content_type` string, required
  - `expires_at` string, required
  - `max_bytes` number, required

## Other responses

- `429`: Rate limit exceeded

---

[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)
