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

# Add domain

> Registers a sending domain and returns DNS records to add.
Add the DKIM, SPF, and DMARC records to your DNS provider,
then call `POST /api/v1/domains/{id}/verification-checks` to confirm the SES identity.
Amazon SES verifies DKIM for the identity, but DMARC must be published by you in DNS.




## OpenAPI

````yaml /openapi.yaml post /api/v1/domains
openapi: 3.0.3
info:
  title: Torpedo API
  version: '1.0'
  description: |
    Torpedo is a transactional email API built for developers.
    Send emails from your own verified domain with a single HTTP call.
  contact:
    email: support@torpedo.co.mz
  termsOfService: https://torpedo.co.mz/terms
servers:
  - url: https://api.torpedo.co.mz
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/domains:
    post:
      tags:
        - Domains
      summary: Add domain
      description: >
        Registers a sending domain and returns DNS records to add.

        Add the DKIM, SPF, and DMARC records to your DNS provider,

        then call `POST /api/v1/domains/{id}/verification-checks` to confirm the
        SES identity.

        Amazon SES verifies DKIM for the identity, but DMARC must be published
        by you in DNS.
      operationId: createDomain
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - domain
              properties:
                domain:
                  type: string
                  example: myapp.com
      responses:
        '201':
          description: Domain created — add the returned DNS records to your provider
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DomainWithDns'
        '402':
          description: Domain limit reached for your plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Domain already registered in this workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DomainWithDns:
      allOf:
        - $ref: '#/components/schemas/Domain'
        - type: object
          properties:
            dns:
              $ref: '#/components/schemas/DomainDns'
    Error:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
                example: Domain not verified
              field:
                type: string
                example: from
    Domain:
      type: object
      properties:
        id:
          type: string
          format: uuid
        domain:
          type: string
          example: myapp.com
        status:
          type: string
          enum:
            - pending
            - verified
            - failed
        createdAt:
          type: string
          format: date-time
        verifiedAt:
          type: string
          format: date-time
          nullable: true
    DomainDns:
      type: object
      properties:
        dkim:
          type: array
          items:
            $ref: '#/components/schemas/DnsRecord'
        spf:
          $ref: '#/components/schemas/DnsRecord'
        dmarc:
          $ref: '#/components/schemas/DnsRecord'
    DnsRecord:
      type: object
      properties:
        type:
          type: string
          example: CNAME
        name:
          type: string
          example: torpedo1._domainkey.myapp.com
        value:
          type: string
          example: torpedo1.dkim.amazonses.com
        status:
          type: string
          enum:
            - pending
            - verified
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        Prefix `tor_` followed by a base64url-encoded random key.
        Obtain one from `POST /api/v1/workspaces` or `POST /api/v1/auth/keys`.

````