The domains API is for full_access application keys: a key sees the domains it covers and can create sending subdomains in them (notify.example.com), which are added to its domains.
Creating a domain
cURL
curl https://mail.example.com/api/v1/domains \
-H "Authorization: Bearer $VOAARO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "notify.example.com"}'Node / Bun
const { data: domain, error } = await voaaro.domains.create({ name: "notify.example.com" })
for (const r of domain!.records) console.log(r.type, r.name, r.value)Python
d = voaaro.Domains.create({"name": "notify.example.com", "capabilities": {"sending": "enabled", "receiving": "disabled"}})
for r in d["records"]:
print(r["type"], r["name"], r["value"])PHP
$domaine = $voaaro->domains->create(['name' => 'notify.example.com']);
foreach ($domaine->records as $r) {
echo "{$r->type} {$r->name} {$r->value}\n";
}Go
domain, err := client.Domains.Create(&voaaro.CreateDomainRequest{Name: "notify.example.com"})
for _, r := range domain.Records {
fmt.Println(r.Type, r.Name, r.Value)
}capabilities:sending(defaultenabled) andreceiving(defaultdisabled), valuesenabledordisabled. Turning both off is refused.regionis accepted for compatibility and ignored (a single server).- Refused with the reason (
422):custom_return_path,tracking_subdomain,open_trackingorclick_trackingset totrue(tracking is set per key),tlsother thanopportunistic. - Name refused (
400): public email provider, the server's own name;403outside the key's domains;409if it already exists.
The records
The response contains records, each with record (DKIM, SPF, MX, DMARC, TLS-RPT, SRV), name, type, value, priority (MX), ttl (Auto), status and need (required or recommended). DKIM is always required; SPF if sending is enabled; MX if sending or receiving is (sending needs it to receive bounces); DMARC recommended.
Verification
status | Meaning |
|---|---|
not_started | not checked yet |
pending | checked every 5 minutes for 72 hours |
verified | everything is in place; checked again every 6 hours |
temporary_failure | a record disappeared after verification; checked again every 5 minutes |
failed | not verified within 72 hours |
POST /api/v1/domains/{id}/verify starts a check right away, and restarts checking for 72 hours on a failed domain. A dedicated sending domain only sends once verified (or in temporary_failure).
To be notified without polling the API, subscribe a webhook of the key to domain.verified and domain.failed: the latter goes out when the domain moves to failed, or to temporary_failure after having been verified.
GET /api/v1/domains returns all the key's domains, from newest to oldest; with limit, it is paged by cursor.
Updating, deleting
PATCH /api/v1/domains/{id}:capabilities(turning off receiving on a domain that has mailboxes:409).DELETE /api/v1/domains/{id}: only a dedicated sending domain, with no email in progress (409otherwise); it is removed from all keys.