API Reference
Domains
Use your own domain for agent email addresses. Add a domain, configure DNS records, and verify ownership to start receiving emails at your custom domain.
Domain Object
| Field | Type | Description |
|---|---|---|
| id | uuid | Unique domain identifier |
| user_id | uuid | Owner user ID |
| domain | string | Domain name (e.g. mail.yourcompany.com) |
| verified | bool | Overall verification status |
| mx_verified | bool | MX record verification status |
| spf_verified | bool | SPF record verification status |
| dkim_key | string | DKIM public key for DNS configuration |
| created_at | timestamp | When the domain was added |
DNS Configuration
After adding a domain, configure these DNS records:
| Type | Host | Value |
|---|---|---|
| MX | @ | agentemail.email (priority 10) |
| TXT | @ | v=spf1 include:agentemail.email ~all |
| TXT | agentemail._domainkey | v=DKIM1; k=rsa; p=<your_dkim_key> |
POST
/api/v1/domainsAPI KeyAdd Domain
Register a custom domain. After adding, configure DNS records and call the verify endpoint.
Request Body
domainstring*Domain name to add
cURL
curl -X POST https://api.agentemail.email/api/v1/domains \ -H "X-API-Key: ak_your_key" \ -H "Content-Type: application/json" \ -d '{"domain":"mail.yourcompany.com"}'
Response
{ "success": true, "data": { "id": "domain-uuid...", "domain": "mail.yourcompany.com", "verified": false, "dkim_key": "MIIBIjANBgkqh..." } }
GET
/api/v1/domainsAPI KeyList Domains
List all custom domains for the authenticated user.
cURL
curl https://api.agentemail.email/api/v1/domains \ -H "X-API-Key: ak_your_key"
GET
/api/v1/domains/{id}/verifyAPI KeyVerify Domain
Trigger DNS verification for a domain. Checks MX, SPF, and DKIM records. Call this after configuring your DNS.
Path Parameters
iduuidDomain ID
cURL
curl https://api.agentemail.email/api/v1/domains/{id}/verify \ -H "X-API-Key: ak_your_key"
Response
{ "success": true, "data": { "verified": true, "mx_verified": true, "spf_verified": true } }
DELETE
/api/v1/domains/{id}API KeyDelete Domain
Remove a custom domain. Existing inboxes on this domain will stop receiving emails.
Path Parameters
iduuidDomain ID
cURL
curl -X DELETE https://api.agentemail.email/api/v1/domains/{id} \ -H "X-API-Key: ak_your_key"