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

# Send Email

> Queues an email for immediate or scheduled delivery.



## OpenAPI

````yaml /openapi.json post /emails
openapi: 3.1.0
info:
  title: Dugble API
  description: >-
    Programmatic access to Dugble email, SMS, sending infrastructure, contacts,
    audiences, suppressions, and broadcasts. Authenticate with a team token sent
    as a Bearer token.
  version: 1.0.0
  contact:
    name: Dugble Support
    email: support@dugble.com
servers:
  - url: https://api.dugble.com
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Email
    description: Send and manage transactional emails.
  - name: SMS
    description: Send and manage SMS messages.
  - name: Domains
    description: Manage and verify sending domains.
  - name: Templates
    description: Create, version, publish, preview, and test reusable email templates.
  - name: Sender IDs
    description: Manage SMS sender IDs.
  - name: Contacts
    description: Manage contacts and their audience memberships.
  - name: Contact Properties
    description: Manage typed custom property definitions used by contacts.
  - name: Topics
    description: Manage contact subscription topics.
  - name: Segments
    description: Manage audience segments.
  - name: Suppressions
    description: Manage suppressed email recipients.
  - name: Broadcasts
    description: Create, schedule, and analyze email broadcasts.
paths:
  /emails:
    post:
      tags:
        - Email
      summary: Send Email
      description: Queues an email for immediate or scheduled delivery.
      operationId: sendEmail
      parameters:
        - $ref: '#/components/parameters/RequiredIdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailSendRequest'
            example:
              from: Acme <onboarding@dugble.me>
              to: ada@example.com
              subject: Welcome to Acme
              html: <h1>Welcome!</h1><p>Your account is ready.</p>
      responses:
        '202':
          description: Email accepted for asynchronous delivery.
          headers:
            Location:
              description: Relative URL of the queued email.
              schema:
                type: string
                example: /emails/49a3999c-0ce1-4ea6-ab68-afcd6dc2e794
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MutationEnvelope'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    RequiredIdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: >-
        Required unique key for email and SMS send requests. Maximum 256
        characters.
      schema:
        type: string
        maxLength: 256
  schemas:
    EmailSendRequest:
      type: object
      required:
        - to
        - subject
      properties:
        from:
          $ref: '#/components/schemas/EmailAddress'
          description: >-
            Optional sender override. When omitted, Dugble resolves the
            configured default sender.
        to:
          $ref: '#/components/schemas/EmailAddressOrList'
        cc:
          $ref: '#/components/schemas/EmailAddressOrList'
        bcc:
          $ref: '#/components/schemas/EmailAddressOrList'
        reply_to:
          $ref: '#/components/schemas/EmailAddressOrList'
        subject:
          type: string
          minLength: 1
          maxLength: 255
        html:
          type: string
          maxLength: 1048576
        text:
          type: string
          maxLength: 1048576
        headers:
          type: object
          additionalProperties:
            type: string
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        scheduled_at:
          type: string
          description: Future ISO 8601 date-time or supported relative schedule value.
        metadata:
          type: object
          additionalProperties: true
      anyOf:
        - required:
            - html
        - required:
            - text
      additionalProperties: false
    MutationEnvelope:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/MutationResponse'
    EmailAddress:
      oneOf:
        - type: string
          example: Ada Lovelace <ada@example.com>
        - $ref: '#/components/schemas/EmailAddressObject'
    EmailAddressOrList:
      oneOf:
        - $ref: '#/components/schemas/EmailAddress'
        - type: array
          items:
            $ref: '#/components/schemas/EmailAddress'
    Attachment:
      type: object
      required:
        - filename
      properties:
        content:
          type: string
          contentEncoding: base64
        filename:
          type: string
        content_type:
          type: string
        content_id:
          type: string
    Tag:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          maxLength: 256
        value:
          type: string
          maxLength: 256
    MutationResponse:
      type: object
      required:
        - object
        - id
      properties:
        object:
          type: string
        id:
          type: string
          format: uuid
    ErrorEnvelope:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - BAD_REQUEST
                - UNAUTHORIZED
                - FORBIDDEN
                - STEP_UP_REQUIRED
                - NOT_FOUND
                - CONFLICT
                - PAYMENT_REQUIRED
                - PAYLOAD_TOO_LARGE
                - UNPROCESSABLE_ENTITY
                - TOO_MANY_REQUESTS
                - INTERNAL_ERROR
                - SERVICE_UNAVAILABLE
            message:
              type: string
    EmailAddressObject:
      type: object
      required:
        - email
      properties:
        email:
          type: string
          format: email
        name:
          type: string
          maxLength: 128
      additionalProperties: false
  responses:
    Error:
      description: >-
        The request failed. See the HTTP status and structured error code for
        the category.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Team token
      description: >-
        Pass a Dugble team token in the Authorization header as Bearer <token>.
        Team token secrets use the dgb_team_ prefix.

````