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

# Send an email

> Send an email to one or multiple recipients



## OpenAPI

````yaml /openapi.json post /v1/emails/send
openapi: 3.0.3
info:
  title: Emailr API
  version: 1.0.0
servers:
  - url: https://api.emailr.dev
    description: Production
security: []
tags:
  - name: emails
    description: Email sending and management
  - name: contacts
    description: Contact management
  - name: templates
    description: Email template management
  - name: domains
    description: Domain verification and management
  - name: webhooks
    description: Webhook configuration
  - name: broadcasts
    description: Broadcast campaign management
  - name: segments
    description: Contact segmentation
paths:
  /v1/emails/send:
    post:
      tags:
        - emails
      summary: Send an email
      description: Send an email to one or multiple recipients
      operationId: sendEmail
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendEmailRequest'
      responses:
        '200':
          description: Email sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    SendEmailRequest:
      type: object
      properties:
        from:
          type: string
          pattern: ^(?:[^<]+<[^@\s]+@[^@\s]+\.[^@\s]+>|[^@\s]+@[^@\s]+\.[^@\s]+)$
          description: >-
            Sender email. Accepts 'email@example.com' or 'Name
            <email@example.com>' format. Required if not using a template with
            from_email set.
          example: John Doe <sender@example.com>
        to:
          anyOf:
            - type: string
              format: email
              example: recipient@example.com
            - type: array
              items:
                type: string
                format: email
              example:
                - recipient1@example.com
                - recipient2@example.com
        cc:
          anyOf:
            - type: string
              format: email
            - type: array
              items:
                type: string
                format: email
          description: CC recipients
          example:
            - cc1@example.com
            - cc2@example.com
        bcc:
          anyOf:
            - type: string
              format: email
            - type: array
              items:
                type: string
                format: email
          description: BCC recipients
          example:
            - bcc1@example.com
            - bcc2@example.com
        subject:
          type: string
          minLength: 1
          description: Email subject. Required if not using a template.
          example: Hello World
        html:
          type: string
          example: <h1>Hello</h1>
        text:
          type: string
          example: Hello
        template_id:
          type: string
          format: uuid
          description: >-
            Template ID. When provided, template values are used for subject,
            html, text, from, reply_to, and preview_text.
          example: 123e4567-e89b-12d3-a456-426614174000
        template_data:
          type: object
          additionalProperties: {}
          description: >-
            Variables to render in the template. Must include all variables
            defined in the template.
          example:
            name: John
            company: Acme
        tags:
          type: object
          additionalProperties:
            type: string
          example:
            campaign: welcome
            source: signup
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        replyTo:
          $ref: '#/components/schemas/ReplyTo'
        reply_to_email:
          type: string
          format: email
          description: Reply-To email address. Overrides template reply_to if provided.
          example: support@example.com
        preview_text:
          type: string
          description: >-
            Preview text (preheader). Overrides template preview_text if
            provided.
          example: Check out our latest updates...
        scheduled_at:
          type: string
          format: date-time
          description: >-
            Schedule email to be sent at this time. If not provided, email is
            sent immediately.
          example: '2024-01-15T10:30:00Z'
        inbox_id:
          type: string
          format: uuid
          description: >-
            Inbox ID to associate with this email. If not provided, resolved
            from template's inbox_id.
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - to
    SendEmailResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message_id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
        recipients:
          type: integer
          example: 1
        scheduled_at:
          type: string
          format: date-time
          description: Present when email is scheduled
          example: '2024-01-15T10:30:00Z'
        status:
          type: string
          description: >-
            Email status: 'sent' for immediate emails, 'scheduled' for scheduled
            emails
          example: sent
      required:
        - success
        - message_id
        - recipients
    Error:
      type: object
      properties:
        error:
          type: string
          example: An error occurred
        code:
          type: string
          example: VALIDATION_ERROR
        details: {}
      required:
        - error
    Attachment:
      type: object
      properties:
        filename:
          type: string
          minLength: 1
          example: document.pdf
        content:
          type: string
          description: Base64 encoded file content
          example: JVBERi0xLjQKJe...
        contentType:
          type: string
          example: application/pdf
      required:
        - filename
        - content
    ReplyTo:
      type: object
      properties:
        in_reply_to:
          type: string
          example: <message-id@domain.com>
        thread_id:
          type: string
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        parent_email_id:
          type: string
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API key authentication. Use your API key as the bearer token.

````