latestOpenAPI 3.1.0MIT2026-08-103050171.2 KB

ebcbb377ee0f

Domains

Create a domain

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

post/services/{serviceId}/domains/{domainName}

Path parameters

serviceIdstring required
Example:01GVRB50KEQFFE1SGMPFRNBG6J

The serviceId where you want to create a domain.

domainNamestring required
Example:yourdomain.com

The name of the domain to create.

Response

The created domain.

resultstring

The result of the create domain operation.

Example response

{
  "result": "domain and route created",
  "records": {
    "receivingRecords": [
      {
        "priority": 10,
        "recordType": "TXT",
        "valid": "valid",
        "value": "mailgun.org"
      }
    ],
    "sendingRecords": [
      {
        "name": "my.domain.com",
        "recordType": "TXT",
        "valid": "valid",
        "value": "mailgun.org"
      }
    ]
  }
}