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

> ## Agent Instructions
> Every Lath operation is POST https://platform.trylath.com/<operation name with dots replaced by slashes>, with a JSON body and `Authorization: Bearer <key>`. `email.send` is POST /email/send.
> Branch on `error.code`, never on `error.message`. Every refusal also carries `error.fix`, which names the next step.
> Send an `Idempotency-Key` header on any operation that is not retry-safe, so a retry cannot run it twice.
> A `lath_test_` key emails only the account's own members and sends no SMS; a `lath_live_` key reaches real recipients and is billed.
> The OpenAPI document, generated from the same registry as the routes, is at https://platform.trylath.com/openapi.json.

# email.send

> Sends one transactional email to one recipient, from the project's default sender, either from a named template with variables or from inline subject and body. Asks the audience policy first: a suppressed address is recorded as suppressed, not sent. Returns the message id and its status.



## OpenAPI

````yaml /api-reference/openapi.json post /email/send
openapi: 3.1.0
info:
  title: Lath API
  version: 0.1.0
  description: >-
    Every operation is one POST. The same set is reachable over MCP, the SDK and
    the CLI; nothing is dashboard-only.
servers:
  - url: https://platform.trylath.com
    description: This deployment
security: []
paths:
  /email/send:
    post:
      tags:
        - email
      summary: email.send
      description: >-
        Sends one transactional email to one recipient, from the project's
        default sender, either from a named template with variables or from
        inline subject and body. Asks the audience policy first: a suppressed
        address is recorded as suppressed, not sent. Returns the message id and
        its status.
      operationId: email.send
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            Replays the stored response for the same key and input; refuses
            different input.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                to:
                  type: string
                  format: email
                  pattern: >-
                    ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                  description: One recipient
                template:
                  description: A template name; provide variables with it
                  type: string
                  minLength: 1
                  maxLength: 120
                locale:
                  description: >-
                    Send the template's variant for this language, falling back
                    to the broader language and then the default. Omit to use
                    the recipient's own locale if one is recorded.
                  type: string
                  maxLength: 20
                variables:
                  type: object
                  propertyNames:
                    type: string
                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                  additionalProperties: {}
                subject:
                  description: >-
                    Inline send: the subject (with template, overrides the
                    template's subject)
                  type: string
                  minLength: 1
                  maxLength: 998
                html:
                  description: 'Inline send: the HTML body'
                  type: string
                  maxLength: 200000
                text:
                  description: >-
                    Inline send: the plain-text body; derived from html when
                    omitted
                  type: string
                  maxLength: 100000
                layout:
                  default: brand
                  description: >-
                    Inline send only: wrap the HTML in the project's themed
                    frame
                  type: string
                  enum:
                    - brand
                    - none
                from:
                  description: >-
                    The project's default sender (omit) or any address on one of
                    its verified domains
                  type: string
                  format: email
                  pattern: >-
                    ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                replyTo:
                  type: string
                  format: email
                  pattern: >-
                    ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                fromName:
                  description: >-
                    The name shown in the inbox beside the address. Defaults to
                    the project's name; pass an empty string to send the bare
                    address.
                  type: string
                  maxLength: 120
                sendAfter:
                  description: >-
                    Hold the message until this moment; omit to send now. Until
                    it is sent it can be stopped with email.message.cancel.
                  type: string
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                metadata:
                  description: >-
                    Up to 20 key/values echoed on every webhook about this
                    message
                  type: object
                  propertyNames:
                    type: string
                    maxLength: 40
                  additionalProperties:
                    anyOf:
                      - type: string
                        maxLength: 500
                      - type: number
                      - type: boolean
                attachments:
                  description: >-
                    Files to attach. Base64 content, at most 10 MB across all of
                    them.
                  maxItems: 10
                  type: array
                  items:
                    type: object
                    properties:
                      filename:
                        type: string
                        minLength: 1
                        maxLength: 200
                      contentType:
                        default: application/octet-stream
                        type: string
                        maxLength: 200
                        pattern: >-
                          ^[a-zA-Z0-9!#$&^_.+-]+\/[a-zA-Z0-9!#$&^_.+-]+(\s*;\s*[a-zA-Z0-9!#$&^_.+-]+=[^\r\n;]{1,80})*$
                      content:
                        type: string
                        format: base64
                        contentEncoding: base64
                        pattern: >-
                          ^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$
                        description: The file's bytes, base64 encoded
                    required:
                      - filename
                      - content
                    additionalProperties: false
              required:
                - to
              additionalProperties: false
      responses:
        '200':
          description: '{ activityId, result }. activityId is empty for reads.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  activityId:
                    type: string
                    description: The activity this call created, or empty for a read.
                  result:
                    $schema: https://json-schema.org/draft/2020-12/schema
                    type: object
                    properties:
                      messageId:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      status:
                        type: string
                        enum:
                          - queued
                          - suppressed
                      attachments:
                        type: array
                        items:
                          type: object
                          properties:
                            filename:
                              type: string
                            contentType:
                              type: string
                            sizeBytes:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - filename
                            - contentType
                            - sizeBytes
                          additionalProperties: {}
                      to:
                        type: string
                      from:
                        type: string
                      fromName:
                        type:
                          - string
                          - 'null'
                      subject:
                        type:
                          - string
                          - 'null'
                      template:
                        type:
                          - string
                          - 'null'
                      templateVersion:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                      templateLocale:
                        type:
                          - string
                          - 'null'
                      sendAfter:
                        anyOf:
                          - type: string
                            format: date-time
                            pattern: >-
                              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                          - type: 'null'
                      suppressed:
                        type: object
                        properties:
                          reason:
                            type: string
                          detail:
                            type: string
                        required:
                          - reason
                          - detail
                        additionalProperties: {}
                    required:
                      - messageId
                      - status
                      - attachments
                      - to
                      - from
                      - fromName
                      - subject
                      - template
                      - templateVersion
                      - templateLocale
                      - sendAfter
                    additionalProperties: {}
                required:
                  - activityId
                  - result
        '400':
          description: invalid_input or invalid_json
        '401':
          description: unauthenticated
        '403':
          description: forbidden
        '404':
          description: not_found
        '409':
          description: 'conflict: idempotency_mismatch, email_taken, last_key'
        '413':
          description: body_too_large
        '429':
          description: rate_limited
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        A Lath API key: lath_live_sk… or lath_test_sk… on a server,
        lath_live_pk… or lath_test_pk… in a browser.

````