Skip to content

API

Sending domains

Create a dedicated sending subdomain, read the DNS records to publish and track its verification.

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 (default enabled) and receiving (default disabled), values enabled or disabled. Turning both off is refused.
  • region is accepted for compatibility and ignored (a single server).
  • Refused with the reason (422): custom_return_path, tracking_subdomain, open_tracking or click_tracking set to true (tracking is set per key), tls other than opportunistic.
  • Name refused (400): public email provider, the server's own name; 403 outside the key's domains; 409 if 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

statusMeaning
not_startednot checked yet
pendingchecked every 5 minutes for 72 hours
verifiedeverything is in place; checked again every 6 hours
temporary_failurea record disappeared after verification; checked again every 5 minutes
failednot 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 (409 otherwise); it is removed from all keys.
Esc