Skip to content

Pro Domains

Add your own custom domains to receive emails. Requires DNS verification.

List Custom Domains

GET /pro/api/domains

Request

bash
curl https://api.mail.cx/pro/api/domains \
  -H "Authorization: Bearer tm_pro_xxxxxxxxxxxx"

Response 200

json
{
  "domains": [
    {
      "id": "d1e2f3a4-b5c6-7890-def1-234567890abc",
      "domain": "yourdomain.com",
      "verify_status": "verified",
      "verify_token": "mailcx-verify-abc123",
      "verified_at": "2025-01-15T12:00:00Z",
      "mx_configured": true,
      "created_at": "2025-01-15T10:00:00Z"
    }
  ]
}

Domain Fields

FieldTypeDescription
iduuidDomain ID
domainstringDomain name
verify_statusstringpending or verified
verify_tokenstringTXT record value for DNS verification
verified_atstring?When the domain was verified (null if pending)
mx_configuredbooleanWhether MX records are correctly configured
created_atstringWhen the domain was added

Add a Custom Domain

POST /pro/api/domains

Request

bash
curl -X POST https://api.mail.cx/pro/api/domains \
  -H "Authorization: Bearer tm_pro_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"domain":"yourdomain.com"}'

Response 201

json
{
  "id": "d1e2f3a4-b5c6-7890-def1-234567890abc",
  "domain": "yourdomain.com",
  "verify_token": "mailcx-verify-abc123",
  "dns_records": [
    {
      "type": "TXT",
      "host": "yourdomain.com",
      "value": "mailcx-verify-abc123"
    },
    {
      "type": "MX",
      "host": "yourdomain.com",
      "value": "mx.mail.cx",
      "priority": 10
    }
  ]
}

DNS Setup

After adding a domain, configure these DNS records:

TypeHostValuePriority
TXTyourdomain.commailcx-verify-abc123
MXyourdomain.commx.mail.cx10

TIP

DNS changes can take up to 48 hours to propagate. In most cases it takes less than 10 minutes.

Errors

StatusError CodeDescription
400invalid_domainInvalid domain name
403domain_limit_reachedDomain limit reached
409domain_already_existsDomain already registered

Verify Domain

POST /pro/api/domains/{id}/verify

Check if DNS records are correctly configured. Call this after setting up DNS.

Request

bash
curl -X POST https://api.mail.cx/pro/api/domains/d1e2f3a4-.../verify \
  -H "Authorization: Bearer tm_pro_xxxxxxxxxxxx"

Response 200 — Verified

json
{
  "verify_status": "verified",
  "txt_record": true,
  "mx_record": true
}

Response 200 — Pending

json
{
  "verify_status": "pending",
  "txt_record": true,
  "mx_record": false,
  "dns_records": [
    {
      "type": "MX",
      "host": "yourdomain.com",
      "value": "mx.mail.cx",
      "priority": 10
    }
  ]
}

The dns_records array only includes records that are still missing or incorrect.

Errors

StatusError CodeDescription
404not_foundDomain not found
410domain_expiredVerification period expired, re-add the domain

Delete a Custom Domain

DELETE /pro/api/domains/{id}

Removes the custom domain. Existing mailboxes on this domain will stop receiving emails.

Request

bash
curl -X DELETE https://api.mail.cx/pro/api/domains/d1e2f3a4-... \
  -H "Authorization: Bearer tm_pro_xxxxxxxxxxxx"

Response 204

No content.

Mail.cx API Documentation