Domains

Add your own domain to send and receive as you@yourcompany.com. Custom domains are included in the free plan.

Add a domain

curl -X POST https://api.mailbay.dev/v1/domains \
  -H "Authorization: Bearer $MAILBAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "acme.com"}'

Mailbay detects your DNS host from the domain's nameservers and answers with the records it needs. Agents can do the same with the MCP tool add_domain.

DNS records

TypeNameValue
MXacme.com10 mx1.mailbay.dev, 20 mx2.mailbay.dev
TXTacme.comv=spf1 include:_spf.mailbay.dev ~all
TXTmb1._domainkey.acme.comv=DKIM1; k=rsa; p=MIIBIjANBgkq…
TXT_dmarc.acme.comv=DMARC1; p=none; rua=mailto:…
CNAMEbounce.acme.combounce.mailbay.dev

MX receives mail. SPF and DKIM let receivers trust mail you send. DMARC tells them what to do when a check fails. The bounce CNAME routes bounces back to us so we can suppress bad addresses.

One click setup

If your domain is on Vercel or Cloudflare, Mailbay writes the records for you with a token you provide, used once and never stored. Everywhere else, copy the records and the dashboard checks each one live.

Verify

curl -X POST https://api.mailbay.dev/v1/domains/{id}/verify \
  -H "Authorization: Bearer $MAILBAY_API_KEY"

We check each record against your authoritative nameservers. A domain is pending until every record matches, then verified. If a record later disappears, it becomes failing and the fix names the record. Pending domains are rechecked every 30 seconds for 10 minutes, then hourly for 72 hours.

Domains that already receive mail

We never delete existing MX records. If your domain already receives mail somewhere else, add a subdomain such as agents.acme.com instead and keep your current mail untouched.

Something unclear or wrong? The API answers every error with a fix, and so should these docs. Back to mailbay.dev