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

# Send email

> Send a transactional email to a recipient. You can provide the email content directly with `html`/`text`, or reference a published template by ID. When using a template, the `from`, `subject`, `html`, `text`, and `reply_to` fields are optional and will be resolved from the template if not provided. The `from` address must belong to a verified domain in your account.



## OpenAPI

````yaml POST /emails
openapi: 3.1.0
info:
  title: SendKit API
  description: The SendKit API allows you to send transactional emails programmatically.
  version: 1.0.0
servers:
  - url: https://api.sendkit.dev
security:
  - bearerAuth: []
paths:
  /emails:
    post:
      tags:
        - Emails
      summary: Send an email
      description: >-
        Send a transactional email to a recipient. You can provide the email
        content directly with `html`/`text`, or reference a published template
        by ID. When using a template, the `from`, `subject`, `html`, `text`, and
        `reply_to` fields are optional and will be resolved from the template if
        not provided. The `from` address must belong to a verified domain in
        your account.
      operationId: sendEmail
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendEmailRequest'
      responses:
        '202':
          description: Email accepted for delivery
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: Unauthorized — missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                name: validation_error
                message: Invalid API key.
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                name: validation_error
                message: The from address domain is not verified.
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                name: rate_limit_exceeded
                message: Rate limit exceeded. Please retry after 30 seconds.
components:
  schemas:
    SendEmailRequest:
      type: object
      required:
        - to
      properties:
        from:
          type: string
          description: >-
            Sender email address. Required unless a template is provided (in
            which case, the template's sender is used as default). Must belong
            to a verified domain.
          example: Your Name <hello@yourdomain.com>
        to:
          oneOf:
            - type: string
              description: A single recipient email address or "Name <email>" format.
            - type: array
              items:
                type: string
              minItems: 1
              maxItems: 50
              description: An array of recipient email addresses or "Name <email>" format.
          description: >-
            Recipient email address(es). Accepts a single email string or an
            array of up to 50 emails. Supports display name format (e.g. "Bob
            <bob@example.com>").
          example: user@example.com
        subject:
          type: string
          maxLength: 998
          description: >-
            Email subject line. Required unless a template is provided. Maximum
            998 characters.
          example: Welcome to SendKit
        html:
          type: string
          description: >-
            HTML body of the email. Required if `text` is not provided and no
            template is used.
          example: <h1>Hello!</h1><p>Welcome aboard.</p>
        text:
          type: string
          description: >-
            Plain text body of the email. Required if `html` is not provided and
            no template is used.
          example: Hello! Welcome aboard.
        cc:
          type: array
          items:
            type: string
          description: >-
            Carbon copy recipients. Supports display name format (e.g. "Name
            <email>").
          example:
            - cc@example.com
        bcc:
          type: array
          items:
            type: string
          description: >-
            Blind carbon copy recipients. Supports display name format (e.g.
            "Name <email>").
          example:
            - bcc@example.com
        reply_to:
          type: array
          items:
            type: string
          description: >-
            Reply-to email addresses. Supports display name format (e.g. "Name
            <email>").
          example:
            - support@yourdomain.com
        headers:
          type: object
          additionalProperties:
            type: string
          description: Custom email headers as key-value pairs.
          example:
            X-Custom-Header: value
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
          description: Metadata tags as key-value pairs.
        scheduled_at:
          type: string
          format: date-time
          description: >-
            Schedule the email for future delivery. Must be a future ISO 8601
            timestamp.
          example: '2026-03-05 10:30:00'
        attachments:
          type: array
          maxItems: 10
          items:
            $ref: '#/components/schemas/Attachment'
          description: File attachments. Maximum 10 per email.
        template:
          type:
            - object
            - 'null'
          description: >-
            Use a published template instead of providing html/text directly.
            When provided, the template's content, subject, and sender are used
            as defaults. Any explicitly provided fields (from, subject, html,
            text, reply_to) will override the template values.
          properties:
            id:
              type: string
              format: uuid
              description: >-
                The template ID. Must be a published template belonging to your
                account.
              example: 550e8400-e29b-41d4-a716-446655440000
            variables:
              type:
                - object
                - 'null'
              additionalProperties:
                type: string
              description: >-
                Key-value pairs to replace {{VARIABLE}} placeholders in the
                template.
              example:
                FIRST_NAME: John
                COMPANY: Acme Inc
          required:
            - id
    SendEmailResponse:
      oneOf:
        - type: object
          description: Returned when sending to a single recipient.
          properties:
            id:
              type: string
              format: uuid
              description: Unique identifier of the created email.
              example: 550e8400-e29b-41d4-a716-446655440000
        - type: object
          description: Returned when sending to multiple recipients.
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: Unique identifier of the created email.
              description: Array of created emails, one per recipient.
    ErrorResponse:
      type: object
      properties:
        name:
          type: string
          description: Error type identifier.
          example: validation_error
        message:
          type: string
          description: Human-readable error message.
          example: The from address domain is not verified.
    Tag:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          maxLength: 256
          description: Tag name.
          example: campaign
        value:
          type: string
          maxLength: 256
          description: Tag value.
          example: welcome
    Attachment:
      type: object
      required:
        - filename
        - content
      properties:
        filename:
          type: string
          maxLength: 255
          description: Name of the file.
          example: invoice.pdf
        content:
          type: string
          description: Base64-encoded file content.
          example: JVBERi0xLjQKJeLj...
        content_type:
          type: string
          maxLength: 255
          description: >-
            MIME type of the file. If not provided, it will be inferred from the
            filename.
          example: application/pdf
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from your SendKit dashboard. Pass it as a Bearer token in the
        Authorization header.

````