API Reference
Domains
The Domains API allows you to manage and verify sending domains for your email campaigns.
Base URL
https://api.unsent.dev/v1/domainsFeatures
Add sending domains
Register new domains for email sending
Domain verification
Automate DNS setup for DKIM, SPF, and DMARC
DNS management
Get DNS records needed for verification
Domain monitoring
Check verification status and health
Regional settings
Configure domains for different AWS regions
Tracking options
Enable open and click tracking per domain
Quick Start
Add a new domain
curl -X POST https://api.unsent.dev/v1/domains \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "yourdomain.com",
"region": "us-east-1"
}'List all domains
curl -X GET https://api.unsent.dev/v1/domains \
-H "Authorization: Bearer your-api-key"Verify a domain
curl -X PUT https://api.unsent.dev/v1/domains/{domainId}/verify \
-H "Authorization: Bearer your-api-key"DNS Configuration
When you add a domain, Unsent provides DNS records that you need to configure:
Required DNS Records
-
TXT Record for SPF
v=spf1 include:amazonses.com ~all -
TXT Record for DKIM
k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA... -
MX Record (optional)
10 mail.yourdomain.com
Verification Process
Add domain via API
Configure DNS records with your domain provider
Verify domain via API or automatic check
Start sending emails from your verified domain
API Endpoints
Domain Status
Status Codes
- NOT_STARTED - Domain added but DNS not configured
- PENDING - DNS records are being verified
- SUCCESS - Domain fully verified and ready for sending
- FAILED - DNS verification failed
- TEMPORARY_FAILURE - Temporary DNS issues, retry later
Supported Regions
- us-east-1 - US East (N. Virginia)
- us-west-2 - US West (Oregon)
- eu-west-1 - Europe (Ireland)
- ap-southeast-1 - Asia Pacific (Singapore)
Best Practices
- Use a custom domain for better deliverability
- Configure all DNS records properly
- Monitor domain health regularly
- Use separate domains for different types of email
- Enable DKIM signing for authentication
- Set up DMARC to prevent spoofing
- Test with small volumes before scaling
Security Considerations
- Domains must be owned by your organization
- DNS records should be kept secure and updated
- Monitor for unauthorized DNS changes
- Use TLS for all API communications