Overview
A domain is a custom sending domain added to a Microsoft 365 tenant already connected to TenantCore. TenantCore supports up to 12 domains per connected tenant. TenantCore exposes the Microsoft 365 DNS records required for the domain and tracks authentication state. For supported connected DNS providers, Complete API users can also start TenantCore’s Automatic DNS workflow instead of publishing those records manually. The standard TenantCore structure is:Getting a domain ready to send is a two-step DNS process, not one. Add the domain, publish the mail records, verify — Microsoft only generates the DKIM selector CNAMEs after verification succeeds. You publish those separately, then enable DKIM. See Verify domain and Enable DKIM below.
If the domain uses a supported connected DNS provider, the Complete API can start this sequence through the UUID-first Automatic DNS API. Automatic DNS only operates on a
domain_id that already belongs to the authenticated TenantCore account.List domains
Returns all custom domains registered on a tenant, including their last-checked DNS status.
Example request
These four
*_status fields are the live, resolved values from public DNS — not a fixed set of states. Match on their content (does it contain the expected Microsoft target?) rather than exact string equality, since the underlying value changes as DNS providers format records differently.
Errors
Get domain by TenantCore UUID
Returns the stored operational state for one domain using the TenantCoredomain_id. This is a cheap database-backed read; it does not perform a live DNS/provider check.
GET /v1/domains/{domain_id}/dns/plan only when you intentionally need a fresh live DNS plan; that route performs external work and uses the expensive-operation rate-limit bucket.
A guessed domain_id belonging to another TenantCore account returns the same 404 domain_not_found response as a nonexistent UUID.
Add domain
Adds a custom domain to a tenant in Microsoft 365 and returns the DNS records you need to publish at your registrar. The domain is created in Microsoft but remains unverified until you publish the verification record and call verify.
Request body
Example request
service_configuration_records at this point — Microsoft does not generate them until after verification. dkim_verification_state and the empty dkim_status above reflect that; this is expected on every freshly added domain, not an error.
domain_id is the TenantCore resource UUID to use immediately with Automatic DNS setup and mailbox creation. You do not need to list domains again just to discover the new resource ID.
After adding a domain
- Publish the
verification_dns_recordsTXT record at your registrar - Publish the mail records from
service_configuration_records(MX, SPF TXT, autodiscover CNAME) - Wait for DNS propagation — usually under 30 minutes, occasionally longer
- Call verify
Verify domain
Checks whether the verification TXT record is publicly visible, and if so, verifies the domain with Microsoft and attempts to enable DKIM as part of the same call.
Example request
dkim_enable_result here is only an attempt — it commonly fails at this point with Exchange not yet able to see the selector CNAMEs, because you have not published them yet. A verified domain with dkim_enable_result.status other than "success" is normal: the selector CNAMEs are now available in service_configuration_records above. Publish them, then call Enable DKIM directly.
Example response — DNS not propagated yet
409 and is the expected result if you call verify before the TXT record has propagated — not a failure to handle specially, just retry after publishing.
Errors
Enable DKIM
Enables DKIM signing for a domain, or returns the selector CNAMEs to publish if Exchange cannot see them yet. This is the same endpoint for both the initial request and the follow-up check — call it again after publishing the records it returns.
Example request
409 and is the normal first response on a fresh domain — it is how you get the selector targets to publish, not a failure. Publish both CNAMEs, then call this endpoint again.
Example response — enabled
"success", Microsoft is signing outbound mail for the domain. Calling this endpoint again afterward is safe and idempotent.
Errors
Get DNS records
Returns the stored DNS records and last-checked DNS status for a specific domain. This does not perform a live DNS re-check — it returns what was last recorded, most recently by Verify domain.
Example request
Delete domain
Permanently removes a custom domain from Microsoft 365 and TenantCore.
Example request
microsoft_deleted is false and already_missing_from_microsoft is true.
Errors