MailStack API

Register a new domain

Registers a new domain with a list of mailboxes in the MailStack system.

post/mailstack/v1/domains

Request body

domainstring required

Domain is the domain name to be registered Required: true Example: example.com

Example request

{
  "domain": "example.com",
  "mailboxes": [
    {
      "forwardingEnabled": true,
      "forwardingTo": "forward@example.com",
      "password": "strongpassword",
      "username": "user@example.com"
    }
  ]
}

Response

Domain registered successfully

autoRenewboolean

AutoRenew indicates whether the domain will be automatically renewed upon expiration Example: true

createdAtstring

CreatedAt is the date and time the domain was registered Example: 2021-09-01T12:00:00Z

domainstring

Domain is the domain name that was registered Example: example.com

expiresAtstring

ExpiresAt is the date and time when the domain registration will expire Example: 2022-09-01T12:00:00Z

lastUpdatedAtstring

LastUpdatedAt is the date and time the domain registration was last updated Example: 2021-09-01T12:00:00Z

messagestring

Message provides additional information about the registration Example: Domain registered successfully

nameserversstring[]

Nameservers lists the nameservers associated with the domain Example: [ns1.example.com, ns2.example.com]

statusstring

Status indicates the result of the domain registration Example: success

Example response

{
  "autoRenew": true,
  "createdAt": "2021-09-01T12:00:00Z",
  "dnsRecords": [
    {
      "name": "example.com",
      "type": "A",
      "value": "192.0.2.1"
    }
  ],
  "domain": "example.com",
  "expiresAt": "2022-09-01T12:00:00Z",
  "lastUpdatedAt": "2021-09-01T12:00:00Z",
  "mailboxes": [
    {
      "createdAt": "2021-09-01T12:00:00Z",
      "email": "user@example.com",
      "lastUpdatedAt": "2021-09-01T12:00:00Z"
    }
  ],
  "message": "Domain registered successfully",
  "nameservers": [
    "[\"ns1.example.com\"",
    " \"ns2.example.com\"]"
  ],
  "status": "success"
}

Changes