> ## 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.

# Create a domain

> Add a new sending domain to your account. The domain will be created with DNS records that you need to configure at your DNS provider before verifying. Your account has a domain limit based on your plan.



## OpenAPI

````yaml POST /domains
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:
  /domains:
    post:
      tags:
        - Domains
      summary: Create a domain
      description: >-
        Add a new sending domain to your account. The domain will be created
        with DNS records that you need to configure at your DNS provider before
        verifying. Your account has a domain limit based on your plan.
      operationId: createDomain
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDomainRequest'
      responses:
        '201':
          description: Domain created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Domain'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden — domain limit reached for your plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: This action is unauthorized.
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    CreateDomainRequest:
      type: object
      required:
        - name
        - region
      properties:
        name:
          type: string
          maxLength: 255
          description: The domain name to add.
          example: yourdomain.com
        region:
          type: string
          description: >-
            The AWS region for the domain. Must be a region with available
            capacity.
          enum:
            - sa-east-1
            - us-east-2
            - eu-central-1
          example: us-east-2
        open_tracking:
          type: boolean
          description: Enable open tracking. Defaults to false.
          default: false
          example: true
        click_tracking:
          type: boolean
          description: Enable click tracking. Defaults to false.
          default: false
          example: true
        tls:
          type: string
          enum:
            - opportunistic
            - enforced
          description: TLS delivery mode. Defaults to opportunistic.
          default: opportunistic
          example: opportunistic
    Domain:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier.
          example: 550e8400-e29b-41d4-a716-446655440000
        name:
          type: string
          description: The domain name.
          example: yourdomain.com
        status:
          type: string
          enum:
            - not_started
            - pending
            - verified
            - partially_verified
            - failed
            - temporary_failure
          description: The current verification status of the domain.
          example: verified
        region:
          type: string
          description: The AWS region where the domain is configured.
          enum:
            - sa-east-1
            - us-east-2
            - eu-central-1
          example: us-east-2
        open_tracking:
          type: boolean
          description: Whether open tracking is enabled.
          example: true
        click_tracking:
          type: boolean
          description: Whether click tracking is enabled.
          example: true
        tls:
          type: string
          enum:
            - opportunistic
            - enforced
          description: The TLS delivery mode.
          example: opportunistic
        sending_enabled:
          type: boolean
          description: Whether sending is enabled for this domain.
          example: true
        dns_records:
          type: array
          items:
            $ref: '#/components/schemas/DnsRecord'
          description: The DNS records that need to be configured for this domain.
        created_at:
          type: string
          format: date-time
          description: When the domain was created.
          example: '2026-03-03 10:00:00'
        updated_at:
          type: string
          format: date-time
          description: When the domain was last updated.
          example: '2026-03-03 10:00:00'
    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.
    DnsRecord:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier.
          example: 550e8400-e29b-41d4-a716-446655440000
        record_type:
          type: string
          enum:
            - SPF
            - DKIM
            - DMARC
            - MX
            - CNAME
            - TXT
          description: The type of DNS record.
          example: DKIM
        name:
          type: string
          description: The DNS record name (hostname).
          example: sendkit._domainkey.yourdomain.com
        value:
          type: string
          description: The DNS record value.
          example: v=DKIM1; k=rsa; p=MIGfMA0...
        ttl:
          type: integer
          description: Time to live in seconds.
          example: 3600
        status:
          type: string
          enum:
            - not_started
            - verified
            - failed
          description: The verification status of this DNS record.
          example: verified
        priority:
          type:
            - integer
            - 'null'
          description: The priority of the DNS record (for MX records).
          example: 10
        created_at:
          type: string
          format: date-time
          description: When the record was created.
          example: '2026-03-03 10:00:00'
        updated_at:
          type: string
          format: date-time
          description: When the record was last updated.
          example: '2026-03-03 10:00:00'
  responses:
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: Invalid API key.
    ValidationError:
      description: Validation error — invalid or missing parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: The email field is required.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from your SendKit dashboard. Pass it as a Bearer token in the
        Authorization header.

````