---
title: "Stage an outbound attachment"
method: POST
path: "/v1/attachments"
tags: ["Messages"]
---

# Stage an outbound attachment

`POST /v1/attachments`

## Request

- Base URL: `https://api.deadsimple.email`
- URL: `https://api.deadsimple.email/v1/attachments`
- Auth: HTTP bearer

Reserve an attachment_id and a presigned S3 URL, then PUT the bytes to that URL and reference the id when sending. Two steps by necessity: a send request cannot carry more than a few megabytes, which is less than one phone photo. The same attachment_id can be attached to any number of messages without re-uploading, and expires after 7 days if unused.

## Request body

- object
  - `filename` string, required
  - `content_type` string: Guessed from the file extension when omitted.
  - `size` integer: Optional; rejected up front if over the limit.

## Response `201`

Attachment staged; PUT the bytes to upload_url

- object
  - `attachment_id` string
  - `upload_url` string, uri
  - `expires_in` integer
  - `max_bytes` integer

---

[API](https://skmtc.dev/deadsimple/apis/dead-simple-email-api.md) · [All operations](https://skmtc.dev/deadsimple/apis/dead-simple-email-api/llms.txt) · [OpenAPI document](https://skmtc.dev/deadsimple/apis/dead-simple-email-api/revisions/c697881be131?raw)
