POST/domains

Create a domain

Creates a domain for sending or receiving email. Supply name and configure the sending region, tracking options, TLS mode, and capabilities as needed; at least one domain capability must be enabled.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

8 body fields

Domain configuration for email sending or receiving.

namestringrequired
The name of the domain you want to create.
regionstringoptional
The region where emails will be sent from. Possible values are us-east-1 | eu-west-1 | sa-east-1 | ap-northeast-1
Allowed:us-east-1eu-west-1sa-east-1ap-northeast-1Default:us-east-1
custom_return_pathstringoptional
For advanced use cases, choose a subdomain for the Return-Path address. Defaults to 'send' (i.e., send.yourdomain.tld).
open_trackingbooleanoptional
Track the open rate of each email.
click_trackingbooleanoptional
Track clicks within the body of each HTML email.
tlsstringoptional
TLS mode. Opportunistic attempts secure connection but falls back to unencrypted. Enforced requires TLS or email won't be sent.
Allowed:opportunisticenforcedDefault:opportunistic
capabilitiesobjectoptional
Configure the domain capabilities for sending and receiving emails. At least one capability must be enabled.
tracking_subdomainstringoptional
The subdomain to use for click and open tracking.

1 status code
201Returns the created domain, including its identifier, name, status, DNS records, region, capabilities, and tracking settings.
idstringoptional
The ID of the domain.
namestringoptional
The name of the domain.
created_atstringoptional
The date and time the domain was created.
statusstringoptional
The status of the domain.
Allowed:pendingverifiedfailednot_startedpartially_verifiedpartially_failed
capabilitiesobjectoptional
Configure the domain capabilities for sending and receiving emails. At least one capability must be enabled.
recordsarray<object>optional
regionstringoptional
The region where the domain is hosted.
open_trackingbooleanoptional
Whether open tracking is enabled for this domain.
click_trackingbooleanoptional
Whether click tracking is enabled for this domain.
tracking_subdomainstringoptional
The subdomain used for click and open tracking.

Error handling

name is required. region must be one of us-east-1, eu-west-1, sa-east-1, or ap-northeast-1, and tls must be opportunistic or enforced. At least one capability must be enabled in capabilities.