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

# Add an email domain

> Add a domain to send email from. Returns the DNS records to publish (DKIM CNAMEs are required; SPF, DMARC, and MAIL FROM are recommended). Publish them at your DNS provider, then verify.



## OpenAPI

````yaml /openapi.json post /v1/email-domains
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url, reaction,
    template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram/Messenger)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/email-domains:
    post:
      tags:
        - Email Domains
      summary: Add an email domain
      description: >-
        Add a domain to send email from. Returns the DNS records to publish
        (DKIM CNAMEs are required; SPF, DMARC, and MAIL FROM are recommended).
        Publish them at your DNS provider, then verify.
      operationId: addEmailDomain
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - domain
              properties:
                domain:
                  type: string
                  description: Bare domain, e.g. example.com.
                  example: example.com
      responses:
        '201':
          description: Domain added.
          content:
            application/json:
              schema:
                type: object
                required:
                  - domain
                properties:
                  domain:
                    $ref: '#/components/schemas/EmailDomain'
        '400':
          description: Invalid domain or setup failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    EmailDomain:
      type: object
      required:
        - id
        - domain
        - status
        - dkimStatus
      properties:
        id:
          type: string
          example: emd_abc123
        domain:
          type: string
          example: example.com
        status:
          type: string
          description: Overall verification status.
          example: pending
        dkimStatus:
          type: string
          example: not_started
        dnsRecords:
          type: array
          description: >-
            DNS records to publish. Present when fetching a single domain or
            after adding one.
          items:
            $ref: '#/components/schemas/EmailDomainDnsRecord'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    EmailDomainDnsRecord:
      type: object
      required:
        - type
        - name
        - value
        - purpose
        - required
      properties:
        type:
          type: string
          description: DNS record type.
          example: CNAME
        name:
          type: string
          description: Record host/name to create.
        value:
          type: string
          description: Record value.
        priority:
          type: integer
          description: Priority (MX records only).
        purpose:
          type: string
          description: What the record is for.
          enum:
            - dkim
            - spf
            - dmarc
            - mail_from
        required:
          type: boolean
          description: >-
            Whether the record is required to verify + send (DKIM) or
            recommended for deliverability.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````