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

# Send an email

> Send an email from a provisioned address to a customer, owner, or raw email address.



## OpenAPI

````yaml openapi-core.json POST /v1/emails
openapi: 3.1.0
info:
  title: Yorlet Core API
  description: Core platform APIs including buildings, customers, units, and tasks.
  version: 1.0.0
servers:
  - url: https://api.yorlet.com
    description: Production
  - url: https://api.yorlet.io
    description: Sandbox
security: []
paths:
  /v1/emails:
    post:
      tags:
        - Emails
      summary: Send an email
      description: >-
        Send an email from a provisioned address to a customer, owner, or raw
        email address.
      operationId: messages_create
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  description: >-
                    The provisioned email address to send from (id or full
                    address). Defaults to the account’s agent address when
                    omitted.
                to:
                  type: string
                  description: >-
                    The recipient email address. Required when `customer` and
                    `owner` are not set.
                customer:
                  type: string
                  description: Send to this customer’s email address.
                owner:
                  type: string
                  description: Send to this owner’s email address.
                subject:
                  type: string
                  minLength: 1
                  maxLength: 998
                  description: The email subject.
                body:
                  type: string
                  minLength: 1
                  maxLength: 20000
                  description: The plain-text body. Rendered into a branded HTML template.
                cc:
                  type: array
                  items:
                    type: string
                  description: Optional CC recipients.
                reply_to:
                  type: string
                  description: Optional Reply-To address. Defaults to the From address.
                thread:
                  type: string
                  description: >-
                    The thread to reply on. Sets In-Reply-To / References from
                    the last inbound message.
                attachments:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: A file id to attach.
                      name:
                        type: string
                        description: The filename shown to the recipient.
                    required:
                      - id
                      - name
                  description: Optional file attachments.
              required:
                - subject
                - body
      responses:
        '200':
          description: Returns the message object if the send succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the object.
                  created:
                    type: number
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  account:
                    type: string
                    description: >-
                      The account that the object belongs to. Only returned if
                      the request is made with a valid Yorlet-Context header.
                  deleted:
                    type: boolean
                    default: false
                    description: Only returned if the object has been deleted.
                  object:
                    type: string
                    enum:
                      - message
                  body:
                    type: string
                    description: Plain-text body, common to all channels.
                  channel:
                    type: string
                    enum:
                      - email
                    description: >-
                      The communication channel for this thread. `email` today;
                      additional channels may be added later.
                  direction:
                    type: string
                    enum:
                      - inbound
                      - outbound
                    description: >-
                      Whether the message was sent by the account or received
                      from a counterparty.
                  email:
                    type: object
                    properties:
                      attachments:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: The attachment id, when available.
                            filename:
                              type:
                                - string
                                - 'null'
                              description: The attachment filename.
                            content_type:
                              type:
                                - string
                                - 'null'
                              description: The MIME type of the attachment.
                        description: Attachments on the email, metadata only.
                      cc:
                        type: array
                        items:
                          type: string
                        description: CC recipients.
                      email_record_id:
                        type:
                          - string
                          - 'null'
                        description: The `email_records` id for outbound sends.
                      from:
                        type: string
                        description: The From address.
                      html:
                        type:
                          - string
                          - 'null'
                        description: HTML body, when available.
                      in_reply_to:
                        type:
                          - string
                          - 'null'
                        description: The Message-ID this email replies to.
                      message_id:
                        type:
                          - string
                          - 'null'
                        description: The RFC Message-ID.
                      subject:
                        type:
                          - string
                          - 'null'
                        description: The email subject.
                      to:
                        type: array
                        items:
                          type: string
                        description: To recipients.
                    description: Email-specific fields. Present when `channel` is `email`.
                    required:
                      - attachments
                      - cc
                      - email_record_id
                      - from
                      - html
                      - in_reply_to
                      - message_id
                      - subject
                      - to
                  thread:
                    type: string
                    description: The thread this message belongs to.
                required:
                  - id
                  - created
                  - object
                  - body
                  - channel
                  - direction
                  - thread
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API Key authentication. Use "Bearer YOUR_API_KEY".

````