Custom domain setup
Send as [email protected] instead of [email protected], without losing any existing thread history.
1. Register the domain
curl -X POST https://myagentmail.com/v1/domains \
-H "X-API-Key: tk_..." -H "Content-Type: application/json" \
-d '{"domain": "mail.yourcompany.com"}'
The response returns the DNS records you need to set. Typically:
- A TXT record for DKIM (long RSA public key)
- A CNAME record for bounce handling
- An MX record pointing to
mail.myagentmail.com
2. Add the records at your DNS provider
Copy the records into your registrar's DNS editor. See the provider-specific guides for Cloudflare, Route 53, GoDaddy, or Namecheap.
If your apex domain already receives mail at another provider, don't add myagentmail's MX record on the apex — you'll break your existing mail flow. Use a subdomain like mail.yourcompany.com instead. See MX records without breaking your primary domain.
3. Verify
curl https://myagentmail.com/v1/domains/mail.yourcompany.com/verify \
-H "X-API-Key: tk_..."
DKIM propagation usually takes 1-15 minutes. If it's not verified yet, wait and retry.
4. Attach the domain as an alias on your inbox
This is the step that makes custom domains not lose thread history. Instead of creating a brand-new inbox on the custom domain, we attach the new address as an alias to your existing inbox:
curl -X POST https://myagentmail.com/v1/inboxes/$ID/addresses \
-H "X-API-Key: tk_..." -H "Content-Type: application/json" \
-d '{"email": "[email protected]", "primary": true}'
Now the inbox accepts mail at both the original @myagentmail.com address AND the new custom address. Outbound From uses the new primary alias. Replies to the old address still land in the same inbox. IMAP and SMTP credentials don't change.
Mental model: one inbox, many addresses
An inbox has one canonical identity (the original username and domain it was born with) and a list of accepted addresses. One of those addresses is marked primary — that's the outbound From. Changing the primary is cheap; the canonical identity is forever and is what IMAP/SMTP authenticate against.