# remove_site_email_domain

Source: https://modulify.ai/docs/api/emails/remove-site-email-domain

Removes an email domain from a site, so the site stops sending from it and mail sent to it is no longer forwarded.

- Title: Remove an email domain from a site
- Scope: `config:write`
- Access: Destructive
- Endpoint: `POST /v1/remove_site_email_domain`

When the site sends from the domain, sending goes back to the built-in address at once, and mail sent to the domain is no longer forwarded, even while its MX record still points here. Its DNS records can be deleted at the DNS host afterwards, and adding the domain again later starts its verification over with a new ownership record.

The tool tells the client to always confirm with you first. It needs the **Manage domains** permission and works on every plan, a [paused](https://modulify.ai/docs/automations/emails#when-your-plan-ends) domain included. See [Remove a domain](https://modulify.ai/docs/automations/emails#remove-a-domain).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/remove_site_email_domain`, sending the inputs below as a JSON object. The token needs the `config:write` scope.

> **Warning**
>
> This method is marked destructive: it deletes or overwrites data. Check the inputs before you call it, and send an [Idempotency-Key](https://modulify.ai/docs/api/idempotency) header whenever you might retry it.

```bash
curl -X POST https://api.modulify.ai/v1/remove_site_email_domain \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID","domainId":"DOMAIN_ID"}'
```

Over MCP, the same method is the [remove_site_email_domain tool](https://modulify.ai/docs/mcp/emails/remove-site-email-domain).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `domainId` | string | Yes | The id of the email domain, from `emailDomains.items` in `get_site_email_settings`. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.