---
title: "Stage a message attachment"
method: POST
path: "/mailboxes/{id}/staged-attachments"
tags: ["Mailboxes", "Messages"]
---

# Stage a message attachment

`POST /mailboxes/{id}/staged-attachments`

## Request

- Base URL: `https://shipmail.to/api/v1`
- URL: `https://shipmail.to/api/v1/mailboxes/{id}/staged-attachments`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://shipmail.to/api/auth/oauth2/authorize`, token URL `https://shipmail.to/api/auth/oauth2/token`)

Upload raw attachment bytes for later use by send or scheduled-message update. The returned ID is bound to this API key, organization, and mailbox, and expires after 24 hours.

## Query parameters

- `filename` string, required

## Headers

- `Idempotency-Key` string
- `X-Shipmail-Organization` string

## Response `201`

Attachment staged.

- StagedAttachment
  - `object` 'staged_attachment', required
  - `id` string, required
  - `mailbox_id` string, required
  - `filename` string, required
  - `content_type` string, required
  - `size` integer, required
  - `sha256` string, required
  - `expires_at` string, date-time, required

## Other responses

- `403`: Insufficient permissions.
- `404`: Resource not found.
- `413`: Validation failed.
- `422`: Validation failed.

---

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