---
title: "Upload bytes through a prepared URL"
method: POST
path: "/staged-attachment-uploads/{token}"
tags: ["Messages"]
---

# Upload bytes through a prepared URL

`POST /staged-attachment-uploads/{token}`

## Request

- Base URL: `https://shipmail.to/api/v1`
- URL: `https://shipmail.to/api/v1/staged-attachment-uploads/{token}`
- Auth: none required

Upload the exact raw bytes declared by a prepared upload. This endpoint uses the signed URL instead of API-key authentication, accepts no source URL, and returns no redirect. The token is consumed after one successful upload.

## Response `201`

Attachment staged and upload token consumed.

- 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

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