Modulify

Remove a custom domain

remove_custom_domain

Removes one custom domain from a site, deleting the domain and its TLS certificate.

The site stops answering on that hostname immediately, anyone following an old link to it lands nowhere, and reconnecting it later means adding it again and waiting for a fresh certificate. The tool tells the client to always confirm with you first.

The site's other domains keep working, and a verification pending through start_domain_verification is not touched. If this domain has a www companion, the companion is promoted into this domain's place rather than deleted, so read the returned domains to see what the site answers on now. Only this domain's own companion is promoted, never another domain's.

The primary domain, the one links to the live site use, is worked out again from what remains. It needs the Manage domains permission in the workspace. See Replacing or removing a domain.

Inputs

Input Type Required Description
projectId string Yes The site id.
workspaceId string Yes The workspace the site belongs to.
domainId string Yes The _id of the custom domain to remove, as get_domain_status or add_custom_domain returned it.