---
title: "Download raw RFC822 (.eml)"
method: GET
path: "/v1/messages/{id}/raw"
tags: ["Messages"]
---

# Download raw RFC822 (.eml)

`GET /v1/messages/{id}/raw`

## Request

- Base URL: `https://api.mails.ai`
- URL: `https://api.mails.ai/v1/messages/{id}/raw`
- Auth: HTTP bearer

**Requires scope:** `read`. Returns the message as a downloadable `.eml` attachment: the exact bytes as received when the raw message was kept (received mail up to 25 MiB), otherwise an RFC822 message rebuilt from the stored fields, with the Message-ID, From, Reply-To, In-Reply-To and References it went out or came in with.

## Path parameters

- `id` string, required

## Response `200`

The raw message. `Content-Disposition: attachment; filename="{id}.eml"`.

## Other responses

- `400`: Invalid request — malformed JSON or a field failed validation. Also `feature_not_enabled` when this server has a feature switched off (custom domains before they are available).
- `401`: Missing or invalid API key.
- `403`: The API key lacks the required scope (`insufficient_scope`), or the token belongs to an app connected by sign-in and this operation is closed to connected apps (`connected_app_not_allowed`).
- `404`: Resource not found in this workspace, or the agent a send names is archived (`agent_archived`).
- `500`: Internal server error.

---

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