Replace the email domain
<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>
Moves the app's email sending to a different domain it already owns.
The current domain is left in place until the new one verifies, so a domain that was already sending keeps sending while DNS propagates. That only holds if it was sending: replacing a domain whose own setup never finished leaves you with no working sender until the new one verifies. During the changeover List email domains returns both.
The new domain has the same requirements as Enable email sending for a domain: connected, ready, and different from the current one. Sending the domain already in use is a 400.
This works only when exactly one email domain is set up. If a previous replacement is still in flight you get a 400, so let it finish or remove one first.
This endpoint is limited to 10 requests per minute.
<Note>configuration_status moves through pending_dns_configuration, pending_user_dns_configuration, pending_domain_verification and then active. The three failed_ values mean setup stopped and you can retry with Retry email domain setup. Only active sends mail.</Note>
<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403.</Note>
Path parameters
ID of the app whose email domains you want to work with.
ID of the app whose email domains you want to work with.
Request body
Example request
{
"domain": "mail.example.com",
"sender_name": "Nordwind Furniture",
"from_email": "no-reply@mail.example.com"
}Response
The new domain's setup started. The old one keeps sending until it verifies.
Example response
{
"domain": "mail.example.com",
"status": "pending_domain_verification",
"email_domain_id": "68b1c0d4e7b91d003c45a1f2",
"dns_records": [
{
"name": "em1234.mail.example.com",
"status": "pending",
"ttl": 300,
"type": "CNAME",
"value": "u1234567.wl123.sendgrid.net"
}
]
}