# Create a domain

Creates a new domain on the specified service to host email templates.

Endpoint: POST /services/{serviceId}/domains/{domainName}
Version: 3.0
Security: BasicAuth, OAuth2

## Path parameters:

  - `serviceId` (string, required)
    The serviceId where you want to create a domain.
    Example: "01GVRB50KEQFFE1SGMPFRNBG6J"

  - `domainName` (string, required)
    The name of the domain to create.
    Example: "yourdomain.com"

## Response 201 fields (application/json):

  - `result` (string)
    The result of the create domain operation.
    Example: "domain and route created"

  - `records` (object)

  - `records.receivingRecords` (array)
    The receiving records of the domain.

  - `records.receivingRecords.isActive` (boolean)
    True if the domain is active.

  - `records.receivingRecords.cached` (array)
    Any cached value of the record.

  - `records.receivingRecords.priority` (integer)
    The priority for the record.
    Example: 10

  - `records.receivingRecords.recordType` (string)
    The type of the record.
    Example: "TXT"

  - `records.receivingRecords.valid` (string)
    The validity of the record.
    Enum: "valid", "invalid"

  - `records.receivingRecords.value` (string)
    The value of the record.
    Example: "mailgun.org"

  - `records.sendingRecords` (array)
    The sending records of the domain.

  - `records.sendingRecords.isActive` (boolean)
    True if the domain is active.

  - `records.sendingRecords.cached` (array)
    Any cached value of the record.

  - `records.sendingRecords.name` (string)
    The name of the domain record.
    Example: "my.domain.com"

  - `records.sendingRecords.recordType` (string)
    The type of the record.
    Example: "TXT"

  - `records.sendingRecords.valid` (string)
    The validity of the record.
    Enum: "valid", "invalid"

  - `records.sendingRecords.value` (string)
    The value of the record.
    Example: "mailgun.org"


