Overview
The Domains API enables you to:- Create and configure custom sending domains
- Verify domain ownership via DNS records
- Configure TLS and tracking settings
- Manage DNS records for email delivery
- Choose regions for domain hosting
Creating a Domain
Create a new domain with optional region and custom return path configuration.After creating a domain, you’ll receive DNS records that must be added to your domain’s DNS configuration before the domain can be verified.
DNS Records
When you create a domain, Resend returns the DNS records you need to add to your domain registrar.Record Structure
Each DNS record contains the following fields:string
The record identifier (e.g., “SPF”, “DKIM”, “MX”)
string
The DNS record name/hostname
string
The DNS record type (TXT, MX, CNAME)
string
The DNS record value to set
string
Time-to-live for the DNS record
json.Number
Priority for MX records
string
Verification status of this record (“verified” or “not_verified”)
Accessing DNS Records
Verifying a Domain
After adding the DNS records to your domain, verify the domain to start sending emails.Verify Domain
Retrieving a Domain
Get details about a specific domain including its verification status and DNS records.Get Domain
Listing Domains
Retrieve all domains in your account with optional pagination.Updating a Domain
Update domain settings including tracking options and TLS configuration.TLS Options
Resend supports two TLS modes:Enforced TLS
Enforced TLS
Requires TLS encryption for all email delivery. If the recipient server doesn’t support TLS, the email will not be delivered.
Opportunistic TLS
Opportunistic TLS
Uses TLS when available but falls back to unencrypted delivery if the recipient server doesn’t support TLS.
Update Example
Update Domain Settings
bool
Enable or disable open tracking for emails sent from this domain
bool
Enable or disable click tracking for emails sent from this domain
TlsOption
TLS enforcement mode:
resend.Enforced or resend.OpportunisticRegion Configuration
When creating a domain, you can specify the region where your domain’s email infrastructure will be hosted.Domain with Region
us-east-1- US East (N. Virginia)eu-west-1- Europe (Ireland)sa-east-1- South America (São Paulo)
Deleting a Domain
Remove a domain from your account. This action cannot be undone.Remove Domain
Complete Example
Here’s a complete workflow for setting up and managing a domain:Complete Domain Workflow
Error Handling
Handle common domain-related errors:Error Handling
Best Practices
Verify DNS Records
Always verify that DNS records are properly configured before attempting domain verification.
Use Custom Return Paths
Configure custom return paths to improve deliverability and branding.
Enable Tracking
Enable open and click tracking to monitor email engagement.
Choose Regions Wisely
Select a region close to your primary audience for better performance.
Next Steps
Send Emails
Start sending emails from your verified domain
Webhooks
Set up webhooks to receive domain events
Broadcasts
Send email campaigns from your domain
API Reference
View the complete Domains API reference