curl --request POST \
--url https://cloudapi.mailercloud.com/v1/domains \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"domain": "example.com"
}
'{
"message": "The record of example.com successfully added to the ClouDns server, and domain created",
"data": {
"id": "zjAKXb",
"domainName": "example.com",
"addedMainDomain": "example.com",
"domainDetails": [
{
"data": "track",
"type": "CNAME",
"name": "mc.example.com",
"value": "mc3035n.mlrcloud.com",
"show": 1
},
{
"data": "dkim",
"type": "CNAME",
"name": "k1._domainkey.example.com",
"value": "dkim.mlrcloud.com",
"show": 1
},
{
"data": "dkim2",
"type": "CNAME",
"name": "k2._domainkey.example.com",
"value": "dkim2.mlrcloud.com",
"show": 1
},
{
"data": "img",
"type": "CNAME",
"name": "img3035n.example.com",
"value": "img3035n.mlrcloud.com",
"show": 1
},
{
"data": "dmarc",
"type": "TXT",
"name": "_dmarc.example.com",
"value": "v=DMARC1; p=reject; sp=none; adkim=s; aspf=s; rua=mailto:dmarc@mlrcloud.com; ruf=mailto:dmarc@mlrcloud.com;",
"show": 1
}
]
}
}Add a Domain
Add a sending domain to your account and get the DNS records to publish at your DNS provider. The domain goes through exactly the same checks as Account Settings → Domains in the app (format, blocked and ISP domains, subdomain depth, duplicates and your plan’s domain limit), and the same DNS records are generated.
After adding the records at your DNS provider, verify the domain from Account Settings → Domains.
Notes
- The domain is case-insensitive and a leading
www.is removed (WWW.Example.comis saved asexample.com). - Subdomains up to 3 levels below the root are allowed (
news.example.com,a.b.c.example.com). - Adding a domain can take a few seconds while its DNS is checked.
POST
/
domains
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/domains \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"domain": "example.com"
}
'{
"message": "The record of example.com successfully added to the ClouDns server, and domain created",
"data": {
"id": "zjAKXb",
"domainName": "example.com",
"addedMainDomain": "example.com",
"domainDetails": [
{
"data": "track",
"type": "CNAME",
"name": "mc.example.com",
"value": "mc3035n.mlrcloud.com",
"show": 1
},
{
"data": "dkim",
"type": "CNAME",
"name": "k1._domainkey.example.com",
"value": "dkim.mlrcloud.com",
"show": 1
},
{
"data": "dkim2",
"type": "CNAME",
"name": "k2._domainkey.example.com",
"value": "dkim2.mlrcloud.com",
"show": 1
},
{
"data": "img",
"type": "CNAME",
"name": "img3035n.example.com",
"value": "img3035n.mlrcloud.com",
"show": 1
},
{
"data": "dmarc",
"type": "TXT",
"name": "_dmarc.example.com",
"value": "v=DMARC1; p=reject; sp=none; adkim=s; aspf=s; rua=mailto:dmarc@mlrcloud.com; ruf=mailto:dmarc@mlrcloud.com;",
"show": 1
}
]
}
}Authorizations
Your Mailercloud API key (plain text, no Bearer prefix). Create keys in Settings → API.
Headers
Request body type
Body
application/json
The domain or subdomain to send from.
Minimum: 3 Maximum: 100
Letters, digits, - and . only; a label must not start or end with -, and the last label must start with a letter.
Required string length:
3 - 100