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

# Get Email by ID

> Retrieve detailed information about a specific email, including full content and delivery logs.

### Headers

<ParamField header="Content-Type" type="string">
  `application/json`
</ParamField>

### Path Parameters

<ParamField path="email_id" type="string" required>
  The unique identifier of the email to retrieve.
</ParamField>

### Response

<ResponseField name="status" type="number">
  HTTP status code. Returns `200` when the email is retrieved successfully.
</ResponseField>

<ResponseField name="message" type="string">
  A human-readable message describing the result of the operation.
</ResponseField>

<ResponseField name="data" type="object">
  Contains complete email details, including full content and delivery logs.

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Unique identifier for the email.
    </ResponseField>

    <ResponseField name="message_id" type="string">
      The message ID used in email headers.
    </ResponseField>

    <ResponseField name="from_address" type="string">
      The sender email address.
    </ResponseField>

    <ResponseField name="to_addresses" type="array">
      Array of recipient email addresses.
    </ResponseField>

    <ResponseField name="subject" type="string">
      The email subject line.
    </ResponseField>

    <ResponseField name="size" type="number">
      Total size of the email in bytes.
    </ResponseField>

    <ResponseField name="inline" type="number">
      Number of inline attachments.
    </ResponseField>

    <ResponseField name="attachments" type="number">
      Number of file attachments.
    </ResponseField>

    <ResponseField name="api_key_id" type="number">
      ID of the API key used to send the email.
    </ResponseField>

    <ResponseField name="snippet" type="string">
      Text preview/snippet of the email content.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp when the email was created.
    </ResponseField>

    <ResponseField name="team_id" type="string">
      The team ID that owns this email.
    </ResponseField>

    <ResponseField name="metadata" type="object">
      Complete email metadata including full text and HTML content.

      <Expandable title="properties">
        <ResponseField name="from" type="string">
          Sender email address.
        </ResponseField>

        <ResponseField name="to" type="array">
          Array of recipient email addresses.
        </ResponseField>

        <ResponseField name="cc" type="array | null">
          CC recipients, if any.
        </ResponseField>

        <ResponseField name="bcc" type="array | null">
          BCC recipients, if any.
        </ResponseField>

        <ResponseField name="reply_to" type="string | null">
          Reply-to email address, if set.
        </ResponseField>

        <ResponseField name="text" type="string">
          Plain text version of the email content.
        </ResponseField>

        <ResponseField name="html" type="string">
          HTML version of the email content.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="opened_at" type="string | null">
      ISO 8601 timestamp when the email was first opened. Null if not opened.
    </ResponseField>

    <ResponseField name="delivered_at" type="string | null">
      ISO 8601 timestamp when the email was delivered. Null if not yet delivered.
    </ResponseField>

    <ResponseField name="click_count" type="number">
      Number of times links in the email were clicked.
    </ResponseField>

    <ResponseField name="status" type="string">
      Current email status. Possible values: `processing`, `queued`, `delivered`, `failed`, `bounced`, `complaint`.
    </ResponseField>

    <ResponseField name="credits_used" type="number">
      Number of credits consumed to send this email.
    </ResponseField>

    <ResponseField name="logs" type="array">
      Chronological delivery logs showing the email's journey through the sending process.

      <Expandable title="properties">
        <ResponseField name="email_id" type="string">
          The email identifier this log entry belongs to.
        </ResponseField>

        <ResponseField name="team_id" type="string">
          The team ID that owns this email.
        </ResponseField>

        <ResponseField name="status" type="string">
          Status at this point in delivery. Possible values: `processing`, `queued`, `delivered`, `failed`, `bounced`.
        </ResponseField>

        <ResponseField name="from" type="string">
          Sender email address.
        </ResponseField>

        <ResponseField name="to" type="string">
          Recipient email address for this log entry.
        </ResponseField>

        <ResponseField name="subject" type="string">
          Email subject line.
        </ResponseField>

        <ResponseField name="response" type="string">
          SMTP server response message.
        </ResponseField>

        <ResponseField name="code" type="string">
          SMTP response code (e.g., `250` for success).
        </ResponseField>

        <ResponseField name="mx_hostname" type="string">
          The MX hostname of the receiving mail server.
        </ResponseField>

        <ResponseField name="time" type="number">
          Unix timestamp of when this log entry was created.
        </ResponseField>

        <ResponseField name="queued_at" type="string">
          ISO 8601 timestamp when the email was queued at this stage.
        </ResponseField>

        <ResponseField name="recipient" type="string">
          The recipient email address.
        </ResponseField>

        <ResponseField name="recipient_type" type="string">
          Type of recipient. Possible values: `to`, `cc`, `bcc`.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
      "status": 200,
      "message": "email retrieved successfully.",
      "data": {
          "id": "xxxxx",
          "message_id": "xxxxx@me.thepurplebox.io",
          "from_address": "hello@yourdomain.com",
          "to_addresses": [
              "user@example.com"
          ],
          "subject": "Test from http client",
          "size": 280,
          "inline": 0,
          "attachments": 0,
          "api_key_id": 2,
          "snippet": "hello world",
          "created_at": "2025-11-18T18:42:21.819994Z",
          "team_id": "xxxxx",
          "metadata": {
              "from": "hello@yourdomain.com",
              "to": [
                  "user@example.com"
              ],
              "cc": null,
              "bcc": null,
              "reply_to": null,
              "text": "hello world",
              "html": ""
          },
          "opened_at": null,
          "delivered_at": "2025-11-18T18:42:23.494Z",
          "click_count": 0,
          "status": "delivered",
          "credits_used": 1,
          "logs": [
              {
                  "email_id": "xxxxx",
                  "team_id": "xxxxx",
                  "status": "delivered",
                  "from": "hello@yourdomain.com",
                  "to": "user@example.com",
                  "subject": "Test from http client",
                  "response": "250 2.0.0 OK xxxxx 6a1803df08f44-882866ae38bsi47823636d6.1634 - gsmtp",
                  "code": "250",
                  "mx_hostname": "gmail-smtp-in.l.google.com",
                  "time": 1763491342,
                  "queued_at": "2025-11-18T18:42:23.494Z",
                  "recipient": "user@example.com",
                  "recipient_type": "to"
              },
              {
                  "email_id": "xxxxx",
                  "team_id": "xxxxx",
                  "status": "queued",
                  "from": "hello@yourdomain.com",
                  "to": "user@example.com",
                  "subject": "Test from http client",
                  "response": "250 Message queued as xxxxx",
                  "code": "250",
                  "mx_hostname": "",
                  "time": 1763491343,
                  "queued_at": "2025-11-18T18:42:23Z",
                  "recipient": "user@example.com",
                  "recipient_type": "to"
              },
              {
                  "email_id": "xxxxx",
                  "team_id": "xxxxx",
                  "status": "processing",
                  "from": "hello@yourdomain.com",
                  "to": "user@example.com",
                  "subject": "Test from http client",
                  "response": "250 2.0.0 Ok: queued as xxxxx",
                  "code": "250",
                  "mx_hostname": "",
                  "time": 1763491341,
                  "queued_at": "",
                  "recipient": "user@example.com",
                  "recipient_type": "to"
              }
          ]
      }
  }
  ```
</ResponseExample>
