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

# Start Domain Setup

> Creates the domain's email accounts using the chosen naming strategy and sets up its mail server. The domain's nameservers must be verified first (see `Check Domain Nameservers`), and setup can only be started once per domain.

Setup runs in the background and returns `202` straight away. Poll `Retrieve Domain` to follow progress: `setup_complete` becomes true and the status moves to `warmup` when it's done.



## OpenAPI

````yaml /openapi-v1.yml post /api/v1/domain/setup/
openapi: 3.1.1
info:
  title: DeliverymanAI API V1
  version: 1.0.0
  description: >-
    API documentation for version 1 of the DeliverymanAI API. These endpoints
    drive campaigns, contact lists, leads and email sequences from your own
    code.


    V1 and V2 share the same API keys, sent in the `X-Api-Key` header.
servers:
  - url: https://api.deliveryman.ai
    description: Deliveryman API Server
security: []
paths:
  /api/v1/domain/setup/:
    post:
      tags:
        - Domains
      summary: Start Domain Setup
      description: >-
        Creates the domain's email accounts using the chosen naming strategy and
        sets up its mail server. The domain's nameservers must be verified first
        (see `Check Domain Nameservers`), and setup can only be started once per
        domain.


        Setup runs in the background and returns `202` straight away. Poll
        `Retrieve Domain` to follow progress: `setup_complete` becomes true and
        the status moves to `warmup` when it's done.
      operationId: domain_setup_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DomainSetupRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Setup Started
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Not Found
        '500':
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Not Available Yet
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: curl
          source: |-
            curl -X POST "https://api.deliveryman.ai/api/v1/domain/setup/" \
              -H "X-Api-Key: YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "domain_id": 0,
                "naming_strategy": "string",
                "custom_names": [],
                "country": "string"
              }'
components:
  schemas:
    DomainSetupRequest:
      properties:
        domain_id:
          description: ID of the domain to set up.
          title: Domain Id
          type: integer
        naming_strategy:
          allOf:
            - $ref: '#/components/schemas/NamingStrategyEnum'
          description: >-
            How the names of the domain's email accounts are generated. `random`
            uses a mix of male and female names, `male` and `female` use only
            male or only female names, and `custom` uses the names given in
            `custom_names`.
          title: Naming Strategy
        custom_names:
          anyOf:
            - items:
                minLength: 1
                type: string
              maxItems: 5
              minItems: 1
              type: array
            - type: 'null'
          default: null
          description: >-
            Required when `naming_strategy` is `custom`, and must be omitted
            otherwise. Up to 5 full names in `Firstname Lastname` format, using
            letters only. Every part of a name must be at least 2 characters
            long, and the first 2 letters of the first and last name must be
            different.
          examples:
            - - John Smith
              - Priya Sharma
          title: Custom Names
        country:
          description: >-
            Country whose common names are used to generate email account names
            (ex. `United States`). Not used for the `custom` naming strategy,
            but still required.
          examples:
            - United States
          maxLength: 100
          minLength: 1
          title: Country
          type: string
      required:
        - domain_id
        - naming_strategy
        - country
      title: DomainSetupRequest
      type: object
    SimpleMessageResponse:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description of the result or error.
      required:
        - message
    NamingStrategyEnum:
      enum:
        - random
        - male
        - female
        - custom
      type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Your API key, sent as the value of the `X-Api-Key` header. In the
        dashboard, go to Integrations and open Deliveryman API Keys to create
        one.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.