---
title: "Upload a file and receive a single-use token"
method: POST
path: "/attachments"
tags: ["Ticket messages"]
---

# Upload a file and receive a single-use token

`POST /attachments`

## Request

- Base URL: `https://there-there.app/api`
- URL: `https://there-there.app/api/attachments`
- Auth: HTTP bearer

Streams a file to storage and returns an opaque token. Reference the token in a message's attachment_ids (and, for inline images, embed it in the body as <img src="cid:TOKEN">). Tokens are single-use, scoped to the creating API token, and deleted ~30 minutes after upload if not used. Max 25 MB per file.

## Headers

- `X-Workspace-Id` integer

## Response `201`

File parked

- object
  - `data` PendingAttachment
    - `token` string
    - `filename` string
    - `mime_type` string
    - `size` integer
    - `expires_at` string, date-time

## Other responses

- `422`: Validation failed
- `429`: Upload rate limit or per-workspace parked cap exceeded

---

[API](https://skmtc.dev/there-there/apis/there-there-api.md) · [All operations](https://skmtc.dev/there-there/apis/there-there-api/llms.txt) · [OpenAPI document](https://skmtc.dev/there-there/apis/there-there-api/revisions/1811fb0febc1?raw)
