---
title: "Download attachment"
method: GET
path: "/v1/attachments/{messageId}/{filename}"
tags: ["attachments"]
---

# Download attachment

`GET /v1/attachments/{messageId}/{filename}`

## Request

- Base URL: `https://api.openmail.sh`
- URL: `https://api.openmail.sh/v1/attachments/{messageId}/{filename}`
- Auth: HTTP bearer

Returns the attachment bytes. Authenticate with `Authorization: Bearer <API_KEY>`. The response is the file itself (not a redirect), so clients can fetch the URL from `attachments[].url` with the same API key they use for the rest of the API.

## Path parameters

- `messageId` string, required
- `filename` string, required

## Response `200`

Attachment file bytes

## Other responses

- `404`: Attachment not found

---

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