---
title: "Delete one sending domain"
url: https://docs.corefinity.com/api/reference/site-settings/delete-site-email-domain
type: endpoint
last_updated: 2026-11-13
feature: email
related:
  - https://docs.corefinity.com/guides/sites/site-settings/outbound-email.md
---
# Delete one sending domain

Removes the sending domain the path names, and its SMTP login: mail from its domain then goes out through the
default sending domain. The default itself can be removed once no other sending domain is left.

```http
DELETE /api/corestack/sites/{site}/email/domains/{domain}
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 12 a minute
- Long-running: answers with an operation to poll
- Try it in the console: off. It deletes data that cannot be brought back. Copy the request and run it yourself when you are sure.

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.
- `domain` (string, required): A sending domain of the site, by its name (such as `mg.harbourandfinch.example.net`) or by its `id` in the email settings.

## Request

### curl

```bash
curl -X DELETE https://manage.corefinity.com/api/corestack/sites/1042/email/domains/mg.harbourandfinch.example.net \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->delete('https://manage.corefinity.com/api/corestack/sites/1042/email/domains/mg.harbourandfinch.example.net');

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/email/domains/mg.harbourandfinch.example.net', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
  },
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.delete(
    "https://manage.corefinity.com/api/corestack/sites/1042/email/domains/mg.harbourandfinch.example.net",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

data = res.json() if res.content else None
```

## Responses

### 202 The sending domain is being removed. Follow `operation.id` until it completes.

```json
{
  "operation": {
    "applied_at": "2026-11-03T09:16:40Z",
    "can_retry": false,
    "cluster": {
      "id": 1017,
      "name": "Northwind UK 1"
    },
    "committed_at": null,
    "completed_at": null,
    "created_at": "2026-11-03T09:16:40Z",
    "environment": {
      "env_id": "rs-northwind-harbourandfinch-example-com",
      "hostname": "harbourandfinch-example-com.northwind.cfstack.example.net",
      "id": 1042,
      "name": "Production",
      "role": "production",
      "role_label": "Production",
      "slug": "production"
    },
    "error": null,
    "failure_reason": null,
    "from_version": null,
    "hot": false,
    "id": 5125,
    "install": null,
    "label": "Mail moved to the default",
    "notes": [],
    "parent_operation_id": null,
    "requested_by": {
      "id": 2012,
      "name": "Daniel Reyes"
    },
    "reset_target": null,
    "result": null,
    "result_state": "none",
    "retried_by_operation_id": null,
    "retries_operation_id": null,
    "retry_requires": null,
    "revealed": null,
    "scope": "site",
    "site": {
      "domain": "harbourandfinch.example.com",
      "id": 1042
    },
    "status": "executing",
    "status_label": "Running",
    "step": "transport",
    "steps": [
      {
        "key": "transport",
        "label": "Mail moved to the default",
        "state": "current"
      },
      {
        "key": "verified",
        "label": "Change verified",
        "state": "todo"
      },
      {
        "key": "revoked",
        "label": "Credentials revoked",
        "state": "todo"
      }
    ],
    "subject": null,
    "summary": "Remove sending domain mg.harbourandfinch.example.net",
    "to_version": null,
    "type": "mail_remove",
    "type_label": "Remove email sending"
  }
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), your company requires two-factor authentication and you have not set it up, or your account has no company that can use Managed Clusters, for example because the company was closed (`company_unavailable` or `company_not_enabled`, whichever the route checks first). For Managed Clusters routes; any other route uses `ForbiddenScopeOrTwoFactor`.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The site id does not exist or is a site you cannot change, the feature is not on for your company (`feature_off`), or the site has no sending domain by that name or id (`tenant_mismatch`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 The domain cannot be removed now. `reason` says why: `state` (the default while another sending domain is left), `unavailable` (this environment does not send email itself, or Corefinity's shared sender is not set up for the site: contact support), `busy` (another change is running), `restore_running`, `removed`, `deleted`, `provisioning` or `managed_elsewhere`.

```json
{
  "code": "busy",
  "message": "Another change to this site is in progress. Wait for it to finish.",
  "reason": "busy"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `company_unavailable` | Your company is unavailable. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 404 | `feature_off` | This feature is not on for your organisation yet. |
| 404 | `tenant_mismatch` | The object does not exist or the token may not see it. Check the id. |
| 409 | `busy` | Another operation is running on the site. Wait for it to finish. |
| 409 | `state` | What the request acts on is not in a state that allows this. Read the message. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Outbound email](https://docs.corefinity.com/guides/sites/site-settings/outbound-email.md)
