> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openmail.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Download raw message

> Returns the original RFC 822 bytes of an inbound message as `message/rfc822`, exactly as received.



## OpenAPI

````yaml https://api.openmail.sh/openapi.json get /v1/messages/{id}/raw
openapi: 3.0.3
info:
  title: OpenMail API
  description: >-
    Email infrastructure API for AI agents. Create inboxes, send and receive
    email, and get real-time notifications via webhooks.
  version: 1.0.0
  license:
    name: Proprietary
servers:
  - url: https://api.openmail.sh
security:
  - bearerAuth: []
tags:
  - name: pods
    description: Isolated sub-accounts for your end users or tenants
  - name: inboxes
    description: Email inboxes and their webhook configuration
  - name: domains
    description: >-
      Custom domains: add your own sending/receiving domain, publish DNS, and
      verify it
  - name: owned-domains
    description: >-
      Domains your organisation controls but does not send from. Prove ownership
      with one TXT record and mail to their addresses stops counting toward the
      cold outreach limits.
  - name: messages
    description: Sending and listing messages
  - name: threads
    description: Conversation threads and read status
  - name: attachments
    description: Downloading and extracting text from attachments
  - name: policy
    description: >-
      Correspondent policy — provider-enforced allow/block rules and allowlist
      mode, scoped per account, pod, or inbox. Account-wide key only.
  - name: limits
    description: >-
      Sending limits: today's cold outreach caps on new recipients, per account,
      inbox, and domain, and what raises them
  - name: webhooks
    description: >-
      Webhook endpoints: where events are sent, how each request is
      authenticated, and the delivery log. Account-wide key only.
  - name: feedback
    description: Reporting bugs, friction, and feature requests to the OpenMail team
paths:
  /v1/messages/{id}/raw:
    get:
      tags:
        - messages
      summary: Download raw message
      description: >-
        Returns the original RFC 822 bytes of an inbound message as
        `message/rfc822`, exactly as received.
      operationId: getRawMessage
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        '200':
          description: Original message bytes
          content:
            message/rfc822:
              schema:
                type: string
                format: binary
              example: "Return-Path: <alice@example.com>\r\nReceived: from mail.example.com by inbound-smtp.eu-north-1.amazonaws.com\r\n for bot@yourdomain.com; Wed, 16 Sep 2026 18:22:58 +0000 (UTC)\r\nAuthentication-Results: amazonses.com; spf=pass; dkim=pass header.i=@example.com; dmarc=pass\r\nDKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=sel;\r\n h=from:to:subject:date:message-id:content-type; bh=y/Rmyv...; b=ZoOqF3...\r\nFrom: Alice <alice@example.com>\r\nTo: bot@yourdomain.com\r\nSubject: Q3 report\r\nDate: Wed, 16 Sep 2026 14:22:53 -0400\r\nMessage-ID: <CAJ=a=Hx...@mail.example.com>\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"b1\"\r\n\r\n--b1\r\nContent-Type: text/plain; charset=\"UTF-8\"\r\n\r\nReport attached.\r\n\r\n--b1\r\nContent-Type: application/pdf; name=\"report.pdf\"\r\nContent-Disposition: attachment; filename=\"report.pdf\"\r\nContent-Transfer-Encoding: base64\r\n\r\nJVBERi0xLjQKJ...\r\n--b1--\r\n"
        '401':
          description: Missing, invalid, or expired API key
          content:
            application/json:
              schema:
                description: Missing, invalid, or expired API key
                allOf:
                  - $ref: '#/components/schemas/Error'
        '404':
          description: Message not found, or its original bytes weren't kept
          content:
            application/json:
              schema:
                description: Message not found, or its original bytes weren't kept
                allOf:
                  - $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      additionalProperties: true
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.