Add an email domain
Add a domain to send email from. domain is validated first: a bare domain (a leading https:// and a trailing path are dropped); anything else, spaces included, is 400 with details.errors[0].path ["domain"]. Adding a domain the project already has returns it with 200 (nothing created), like POST /v2/channels.
Returns the DNS records to publish; the DKIM CNAMEs are required. If they could not be generated, the domain is still created (201) but comes back verifiable: false with setupError: remove it and add it again, or contact support. Verify cannot fix it.
Publish the records exactly as returned, verify, then connect an address with POST /v2/channels {"type":"email"}.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Body
application/json
domainstringrequired
Responses
200Already a domain of this project; returned as it is, nothing created.
domainobjectrequired7 properties
idstringrequireddomainstringrequiredstatusstringrequiredOverall verification status.
dkimStatusstringrequireddnsRecordsobject[]DNS records to publish. Present when fetching a single domain or after adding one.
6 properties
typestringrequiredDNS record type.
namestringrequiredRecord host/name to create.
valuestringrequiredRecord value.
priorityintegerPriority (MX records only).
purposestringrequiredWhat the record is for.
One ofdkimspfdmarcmail_fromrequiredbooleanrequiredWhether the record is required to verify + send (DKIM) or recommended for deliverability.
verifiablebooleanPresent with
dnsRecords. False when the DKIM records could not be generated: such a domain cannot verify whatever DNS you publish, andsetupErrorsays what to do.setupErrorobjectPresent when
verifiableis false.recommendationis the same everywhere this domain is refused (POST .../verify,POST /v2/channels): remove the domain and add it again, which sets it up from scratch; contact support if the new one has nodkimrecord either. It never says to retry verify or to publish the other records.3 properties
codestringOne ofdkim_records_unavailablemessagestringrecommendationstring
201Domain added.
domainobjectrequired7 properties
idstringrequireddomainstringrequiredstatusstringrequiredOverall verification status.
dkimStatusstringrequireddnsRecordsobject[]DNS records to publish. Present when fetching a single domain or after adding one.
6 properties
typestringrequiredDNS record type.
namestringrequiredRecord host/name to create.
valuestringrequiredRecord value.
priorityintegerPriority (MX records only).
purposestringrequiredWhat the record is for.
One ofdkimspfdmarcmail_fromrequiredbooleanrequiredWhether the record is required to verify + send (DKIM) or recommended for deliverability.
verifiablebooleanPresent with
dnsRecords. False when the DKIM records could not be generated: such a domain cannot verify whatever DNS you publish, andsetupErrorsays what to do.setupErrorobjectPresent when
verifiableis false.recommendationis the same everywhere this domain is refused (POST .../verify,POST /v2/channels): remove the domain and add it again, which sets it up from scratch; contact support if the new one has nodkimrecord either. It never says to retry verify or to publish the other records.3 properties
codestringOne ofdkim_records_unavailablemessagestringrecommendationstring
400Missing or invalid `domain` (`details.errors`, `path: ["domain"]`), or the domain could not be set up (the message says what to do).
codestringrequiredmessagestringrequireddetailsobjectMachine-readable context. Keys that mean the same thing everywhere: -
errors: present on every400 invalid_requestfor an invalid body or query parameter,[{path, message, ...}],pathnaming the field (["to"],["contacts", 2, "recipient"],["limit"]). -recommendation: one sentence saying what to do next. -dashboardUrl: the dashboard screen that fixes it. -connect: on409 no_channel, the channels this project can connect to reach the recipient, each{type, request, note, available, dashboardUrl?};requestis the exact call (POST /v2/channelswith its body, orPOST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger).available: falsesays why innote(one-way SMS closed until business verification is approved). -address/from: the address the error is about, under the name the request used for it.1 properties
errorsobject[]3 properties
pathobject[]requiredmessagestringrequiredcodestring
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobjectMachine-readable context. Keys that mean the same thing everywhere: -
errors: present on every400 invalid_requestfor an invalid body or query parameter,[{path, message, ...}],pathnaming the field (["to"],["contacts", 2, "recipient"],["limit"]). -recommendation: one sentence saying what to do next. -dashboardUrl: the dashboard screen that fixes it. -connect: on409 no_channel, the channels this project can connect to reach the recipient, each{type, request, note, available, dashboardUrl?};requestis the exact call (POST /v2/channelswith its body, orPOST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger).available: falsesays why innote(one-way SMS closed until business verification is approved). -address/from: the address the error is about, under the name the request used for it.1 properties
errorsobject[]3 properties
pathobject[]requiredmessagestringrequiredcodestring