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

# Add a custom domain

> Add a bring-your-own domain. Returns the DNS records to publish. Requires a paid plan.



## OpenAPI

````yaml POST /domains
openapi: 3.1.0
info:
  title: SentFromAI API
  version: 0.1.0
  description: >-
    Comms infrastructure for AI agents. Email send/receive, threading,
    attachments, drafts, webhooks, realtime, and search.
servers:
  - url: https://api.sentfrom.ai/v1
security:
  - bearerAuth: []
tags:
  - name: inboxes
  - name: messages
  - name: threads
  - name: drafts
  - name: webhooks
  - name: labels
  - name: lists
  - name: attachments
  - name: domains
    description: Custom sending domains
paths:
  /domains:
    post:
      tags:
        - domains
      summary: Add a custom domain
      description: >-
        Add a bring-your-own domain. Returns the DNS records to publish.
        Requires a paid plan.
      operationId: createDomain
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDomain'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainWithRecords'
        '402':
          description: Plan upgrade required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  upgrade:
                    type: boolean
components:
  schemas:
    CreateDomain:
      type: object
      required:
        - hostname
      properties:
        hostname:
          type: string
          example: mail.yourcompany.com
    DomainWithRecords:
      allOf:
        - $ref: '#/components/schemas/Domain'
        - type: object
          properties:
            records:
              type: array
              items:
                $ref: '#/components/schemas/DnsRecord'
    Domain:
      type: object
      properties:
        id:
          type: string
          format: uuid
        hostname:
          type: string
          example: mail.yourcompany.com
        kind:
          type: string
          enum:
            - system
            - tenant_subdomain
            - byo
        status:
          type: string
          enum:
            - pending
            - verifying
            - verified
            - failed
        mail_from_domain:
          type: string
          nullable: true
        mail_from_status:
          type: string
          enum:
            - pending
            - success
            - failed
          nullable: true
        dmarc_policy:
          type: string
          enum:
            - none
            - quarantine
            - reject
        verified_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
    DnsRecord:
      type: object
      properties:
        type:
          type: string
          enum:
            - CNAME
            - TXT
            - MX
        name:
          type: string
          description: Fully-qualified record name
        content:
          type: string
        priority:
          type: integer
          nullable: true
          description: For MX records
        purpose:
          type: string
          description: dkim | spf | dmarc | inbound-mx | mailfrom-mx | mailfrom-spf
      required:
        - type
        - name
        - content
        - purpose
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````