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

# Retrieve Sent Email

> Returns a single email sent through the API, with its opens, clicks, bounce, unsubscribe and replies, by its `message_id`. Use this to catch up on an email's activity if a webhook was missed, or to check whether a `scheduled` email has gone out.



## OpenAPI

````yaml /openapi.yml get /api/v2/email/
openapi: 3.1.1
info:
  title: DeliverymanAI API
  version: 2.0.0
  description: >-
    API documentation for DeliverymanAI. Send emails, track their delivery and
    engagement, read replies, verify addresses, manage your suppression list and
    receive webhook events.


    **Strongly recommended:** leave 5 to 10 minutes between emails sent from the
    same domain. Sending many emails from one domain in a short time can hurt
    your domain and IP reputation.


    **Rate limits:** emails from one sending domain go out at least a minimum
    interval apart. If you send sooner, the email is queued and `Send Email`
    returns `202`. Each endpoint also caps how many requests your account can
    make per minute. Over the cap you get `429` with a `Retry-After` header.
    Treat these limits as an upper bound and keep to the gap recommended above.
servers:
  - url: https://api.deliveryman.ai
    description: Deliveryman API Server
security: []
paths:
  /api/v2/email/:
    get:
      tags:
        - Email
      summary: Retrieve Sent Email
      description: >-
        Returns a single email sent through the API, with its opens, clicks,
        bounce, unsubscribe and replies, by its `message_id`. Use this to catch
        up on an email's activity if a webhook was missed, or to check whether a
        `scheduled` email has gone out.
      operationId: v2_retrieve_sent_email
      parameters:
        - in: query
          name: message_id
          schema:
            maxLength: 40
            minLength: 1
            title: Message Id
            type: string
          description: >-
            The `message_id` returned by `Send Email`. Works for `scheduled`
            emails too.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SentEmail'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
          description: Not Found
        '500':
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: curl
          source: >-
            curl
            "https://api.deliveryman.ai/api/v2/email/?message_id=em_9f2c4a7b1e0d3c5a8b6f4e21"
            \
              -H "X-Api-Key: YOUR_API_KEY"
components:
  schemas:
    SentEmail:
      type: object
      description: An email sent through the API, with its activity.
      properties:
        from:
          type: string
          description: Email address the email was sent from.
        message_id:
          type: string
          description: >-
            Unique ID of the email, available as soon as it's accepted,
            including while it's `scheduled`. Use it to look the email up with
            `Retrieve Sent Email`, to match webhook events, and as
            `reply_to_message_id` to reply in the same conversation. It's also
            sent with the email in the `X-Deliveryman-Message-Id` header.
        to:
          type: string
          description: Recipient email address.
        thread_message_id:
          type: string
          description: >-
            `message_id` of the first email in this conversation. Equal to
            `message_id` unless this email was sent as a reply.
          readOnly: true
        in_reply_to:
          type:
            - string
            - 'null'
          description: >-
            `message_id` this email replied to, or null if it started a
            conversation.
        subject:
          type: string
          description: Subject line of the email.
        html_content:
          type:
            - string
            - 'null'
          description: HTML body, or null for plain text emails.
        plain_text_content:
          type:
            - string
            - 'null'
          description: Plain text body, or null for HTML emails.
        open_tracking:
          type: boolean
          description: Whether opens are tracked for this email.
        click_tracking:
          type: boolean
          description: Whether link clicks are tracked for this email.
        status:
          allOf:
            - $ref: '#/components/schemas/SentEmailStatusEnum'
          description: >-
            Delivery status, updated as the mail server reports back.
            `scheduled`: waiting in the queue for your sending domain's next
            send slot. `queued`: accepted and waiting for the recipient's mail
            server to accept it. `delivered`: the recipient's mail server
            accepted it. `failed`: couldn't be delivered because of a problem on
            the sending side, or a `scheduled` email couldn't be sent (see
            `failure_reason`). The recipient is not suppressed. `bounced`: the
            recipient's server rejected it and the address was added to your
            suppression list. `failed` and `bounced` are final. A `delivered`
            email can still become `bounced` if a bounce arrives later.


            * `scheduled` - Scheduled

            * `queued` - Queued

            * `delivered` - Delivered

            * `failed` - Failed

            * `bounced` - Bounced
        failure_reason:
          type:
            - string
            - 'null'
          description: Why a `scheduled` email couldn't be sent, or null.
        scheduled_for:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When a `scheduled` email will be handed to the mail server, or null
            if it was sent right away. ISO 8601, UTC.
        sent_on:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the recipient's mail server accepted the email. Null until
            delivery is confirmed. ISO 8601, UTC.
        opens:
          type: array
          items:
            $ref: '#/components/schemas/OpenEvent'
          readOnly: true
          description: Opens of this email, oldest first. Empty when open tracking is off.
        clicks:
          type: array
          items:
            $ref: '#/components/schemas/ClickEvent'
          readOnly: true
          description: >-
            Link clicks in this email, oldest first. Empty when click tracking
            is off.
        bounce:
          oneOf:
            - $ref: '#/components/schemas/Bounce'
            - type: 'null'
          readOnly: true
          description: Bounce details, or null if the email didn't bounce.
        unsubscribed_on:
          type:
            - string
            - 'null'
          format: date-time
          description: When the recipient unsubscribed through this email, or null.
        replies:
          type: array
          items:
            $ref: '#/components/schemas/Reply'
          readOnly: true
          description: >-
            Replies received in the conversation this email started, oldest
            first. Always empty for emails sent as a reply. Their replies are
            listed on the conversation's first email.
      required:
        - bounce
        - clicks
        - from
        - html_content
        - in_reply_to
        - message_id
        - opens
        - plain_text_content
        - replies
        - subject
        - thread_message_id
        - to
    MessageResponse:
      type: object
      description: A message describing the result of the request, or what went wrong.
      properties:
        message:
          type: string
          description: Human readable description of the result or error.
      required:
        - message
    SentEmailStatusEnum:
      enum:
        - scheduled
        - queued
        - delivered
        - failed
        - bounced
      type: string
      description: |-
        * `scheduled` - Scheduled
        * `queued` - Queued
        * `delivered` - Delivered
        * `failed` - Failed
        * `bounced` - Bounced
    OpenEvent:
      type: object
      description: An open of the email.
      properties:
        opened_on:
          type: string
          format: date-time
          description: When the email was opened. ISO 8601, UTC.
      required:
        - opened_on
    ClickEvent:
      type: object
      description: A click on a link in the email.
      properties:
        link:
          type: string
          description: URL that was clicked.
        clicked_on:
          type: string
          format: date-time
          description: When the link was clicked. ISO 8601, UTC.
      required:
        - clicked_on
        - link
    Bounce:
      type: object
      description: Why and when the email bounced.
      properties:
        reason:
          type: string
          description: Bounce message returned by the receiving mail server.
        bounced_on:
          type: string
          format: date-time
          description: When the bounce was received. ISO 8601, UTC.
      required:
        - bounced_on
        - reason
    Reply:
      type: object
      description: A reply received in a conversation.
      properties:
        from:
          type: string
          description: Sender of the reply, including their name when available.
        message_id:
          type: string
          description: >-
            Unique ID of the reply. Pass it as `reply_to_message_id` to answer
            this reply.
        subject:
          type:
            - string
            - 'null'
          description: Subject line of the reply.
        plain_text_content:
          type: string
          description: Plain text body of the reply.
          readOnly: true
        html_content:
          type: string
          description: HTML body of the reply.
          readOnly: true
        is_auto_reply:
          type: boolean
          description: >-
            True when the reply is an automatic response, such as an out of
            office message.
        received_on:
          type: string
          format: date-time
          description: When the reply was received. ISO 8601, UTC.
      required:
        - from
        - html_content
        - message_id
        - plain_text_content
        - received_on
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Your API key. In the dashboard, go to Integrations and open Deliveryman
        API Keys to create one.

````

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