Domain Verification
Verifying your domain proves to receiving mail servers that you’ve authorized RelayPost to send on your behalf. This significantly improves inbox placement.
How it works
Section titled “How it works”When you add a domain, RelayPost generates:
- A DKIM key pair — used to cryptographically sign your emails
- DNS records — that you add to your domain’s DNS settings
Once the records are in place, RelayPost verifies them and marks your domain as verified.
Add and verify a domain
Section titled “Add and verify a domain”-
Add the domain
POST
/api/v1/domainsTerminal window curl -X POST https://relaypost.dev/api/v1/domains \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_KEY" \-d '{ "domain": "yourapp.com" }'Response:
{"data": {"id": "dom_abc123","domain": "yourapp.com","is_verified": false,"spf_verified": false,"dkim_verified": false,"dkim_selector": "relaypost","dkim_public_key": "MIGfMA0GCSqGSIb3DQEBAQUAA4...","dns_records": [{"type": "TXT","name": "relaypost._domainkey.yourapp.com","value": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4..."},{"type": "TXT","name": "yourapp.com","value": "v=spf1 include:relaypost.dev ~all"}],"created_at": "2025-01-15T10:30:00.000Z"}}The response includes the
dkim_selectoranddkim_public_keyyou’ll need for DNS. -
Add DNS records
Add these records at your DNS provider (Cloudflare, Route 53, Namecheap, etc.):
DKIM record (TXT)
Field Value Type TXTName {dkimSelector}._domainkey.yourapp.comValue v=DKIM1; k=rsa; p={dkimPublicKey}SPF record (TXT)
Field Value Type TXTName yourapp.comValue v=spf1 include:relaypost.dev ~all -
Trigger verification
DNS propagation can take up to 48 hours, but usually completes within minutes. Once propagated:
GET
/api/v1/domains/:id/verifyTerminal window curl "https://relaypost.dev/api/v1/domains/dom_abc123/verify" \-H "Authorization: Bearer YOUR_API_KEY"Response:
{"data": {"id": "dom_abc123","domain": "yourapp.com","is_verified": true,"spf_verified": true,"dkim_verified": true,"dkim_selector": "relaypost","dkim_public_key": "MIGfMA0GCSqGSIb3DQEBAQUAA4...","verified_at": "2025-01-15T11:00:00.000Z","created_at": "2025-01-15T10:30:00.000Z"}}The response shows which checks passed. Both
spf_verifiedanddkim_verifiedmust betruefor full verification.
Check domain status
Section titled “Check domain status”GET /api/v1/domains
curl "https://relaypost.dev/api/v1/domains" \ -H "Authorization: Bearer YOUR_API_KEY"Response:
{ "data": [ { "id": "dom_abc123", "domain": "yourapp.com", "is_verified": true, "spf_verified": true, "dkim_verified": true, "dkim_selector": "relaypost", "dkim_public_key": "MIGfMA0GCSqGSIb3DQEBAQUAA4...", "verified_at": "2025-01-15T11:00:00.000Z", "created_at": "2025-01-15T10:30:00.000Z" } ]}Troubleshooting
Section titled “Troubleshooting”| Issue | Solution |
|---|---|
| SPF fails | Make sure include:relaypost.dev is in your SPF record and you don’t have multiple SPF records |
| DKIM fails | Check the selector name matches exactly: {selector}._domainkey.yourapp.com |
| Both fail | DNS may not have propagated yet — wait 15-30 minutes and try again |
| Still failing | Some DNS providers add quotes around TXT values automatically — make sure there aren’t double quotes |