> ## 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.

# Send email

> Send an email from an inbox. Requires Idempotency-Key header. Use threadId to reply to an existing thread. When replying on a thread where your inbox was CC'd (deliveryRole cc), the original sender is automatically CC'd.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/inboxes/{id}/send
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: messages
    description: Sending and listing messages
  - name: threads
    description: Conversation threads and read status
  - name: attachments
    description: Downloading and extracting text from attachments
paths:
  /v1/inboxes/{id}/send:
    post:
      tags:
        - messages
      summary: Send email
      description: >-
        Send an email from an inbox. Requires Idempotency-Key header. Use
        threadId to reply to an existing thread. When replying on a thread where
        your inbox was CC'd (deliveryRole cc), the original sender is
        automatically CC'd.
      operationId: sendEmail
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
        - schema:
            type: string
          in: header
          name: idempotency-key
          required: false
          description: Unique key for idempotent sends (e.g. UUID)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - to
                - body
              properties:
                to:
                  type: string
                  format: email
                subject:
                  type: string
                  minLength: 1
                  maxLength: 998
                  description: >-
                    Required for new threads. Optional when threadId is set —
                    the thread subject is used automatically (with Re: prefix).
                body:
                  type: string
                  minLength: 1
                  maxLength: 100000
                  description: >-
                    Email body. Plain text or HTML — HTML is auto-detected and
                    rendered, with a plain-text fallback generated
                    automatically.
                bodyHtml:
                  type: string
                  maxLength: 500000
                  description: >-
                    Provide only when the plain-text and HTML versions must
                    differ. Omit for normal sends — put HTML in `body` instead.
                threadId:
                  type: string
                  description: Thread ID for replies
                includeQuote:
                  type: boolean
                  description: >-
                    When replying with threadId, append a quoted copy of the
                    previous message to the body. Defaults to true. Set false to
                    send only your reply text.
                replyTo:
                  type: string
                  format: email
                  description: >-
                    Optional. Address that replies should be routed to (set as
                    the `Reply-To` MIME header). Free plan: must be the address
                    of an inbox you own in OpenMail. Pro plan or higher: any
                    valid email address.
                cc:
                  type: array
                  items:
                    type: string
                    format: email
                  description: Optional CC recipients.
          multipart/form-data:
            schema:
              type: object
              required:
                - to
                - body
              properties:
                to:
                  type: string
                  format: email
                subject:
                  type: string
                  minLength: 1
                  maxLength: 998
                  description: >-
                    Required for new threads. Optional when threadId is set —
                    the thread subject is used automatically (with Re: prefix).
                body:
                  type: string
                  minLength: 1
                  maxLength: 100000
                  description: >-
                    Email body. Plain text or HTML — HTML is auto-detected and
                    rendered, with a plain-text fallback generated
                    automatically.
                bodyHtml:
                  type: string
                  maxLength: 500000
                  description: >-
                    Provide only when the plain-text and HTML versions must
                    differ. Omit for normal sends — put HTML in `body` instead.
                threadId:
                  type: string
                  description: Thread ID for replies
                includeQuote:
                  type: boolean
                  description: >-
                    When replying with threadId, append a quoted copy of the
                    previous message to the body. Defaults to true. Set false to
                    send only your reply text.
                replyTo:
                  type: string
                  format: email
                  description: >-
                    Optional. Address that replies should be routed to (set as
                    the `Reply-To` MIME header). Free plan: must be the address
                    of an inbox you own in OpenMail. Pro plan or higher: any
                    valid email address.
                cc:
                  type: array
                  items:
                    type: string
                    format: email
                  description: Optional CC recipients.
                attachments:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: File attachments (max 25 MB total per email)
      responses:
        '200':
          description: Email sent (or idempotent replay)
          content:
            application/json:
              schema:
                description: Email sent (or idempotent replay)
                type: object
                additionalProperties: true
                properties:
                  messageId:
                    type: string
                  threadId:
                    type: string
                  providerMessageId:
                    type: string
                  status:
                    type: string
                    enum:
                      - pending
                      - sent
                      - failed
        '400':
          description: >-
            Missing Idempotency-Key, missing request body, invalid
            'to'/'replyTo'/'cc' address, or missing subject when required
          content:
            application/json:
              schema:
                description: >-
                  Missing Idempotency-Key, missing request body, invalid
                  'to'/'replyTo'/'cc' address, or missing subject when required
                allOf:
                  - $ref: '#/components/schemas/Error'
        '402':
          description: >-
            Sending is paused because this account's monthly spend limit was
            reached (`spend_cap_paused`)
          content:
            application/json:
              schema:
                description: >-
                  Sending is paused because this account's monthly spend limit
                  was reached (`spend_cap_paused`)
                allOf:
                  - $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Feature requires a paid plan. Returned when a free-plan customer
            sets `replyTo` to an address that is not one of their own OpenMail
            inboxes (`feature_requires_paid_plan`), the account is banned
            (`account_banned`), or sending is suspended due to
            deliverability/abuse signals (`reputation_suspended`).
          content:
            application/json:
              schema:
                description: >-
                  Feature requires a paid plan. Returned when a free-plan
                  customer sets `replyTo` to an address that is not one of their
                  own OpenMail inboxes (`feature_requires_paid_plan`), the
                  account is banned (`account_banned`), or sending is suspended
                  due to deliverability/abuse signals (`reputation_suspended`).
                allOf:
                  - $ref: '#/components/schemas/Error'
        '404':
          description: Inbox or thread not found
          content:
            application/json:
              schema:
                description: Inbox or thread not found
                allOf:
                  - $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Content blocked (`unsafe_content`, `phishing_detected`), recipient
            domain has no MX records (`no_mx_records`), recipient suppressed for
            bounce/complaint (`recipient_suppressed`), or account storage limit
            exceeded (`storage_limit_exceeded`)
          content:
            application/json:
              schema:
                description: >-
                  Content blocked (`unsafe_content`, `phishing_detected`),
                  recipient domain has no MX records (`no_mx_records`),
                  recipient suppressed for bounce/complaint
                  (`recipient_suppressed`), or account storage limit exceeded
                  (`storage_limit_exceeded`)
                allOf:
                  - $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit exceeded (global daily, per-inbox daily, per-inbox burst)
            or cold outreach limit. Check the Retry-After response header.
          content:
            application/json:
              schema:
                description: >-
                  Rate limit exceeded (global daily, per-inbox daily, per-inbox
                  burst) or cold outreach limit. Check the Retry-After response
                  header.
                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

````