---
title: "Update the default sending domain"
url: https://docs.corefinity.com/api/reference/site-settings/update-site-email-default-domain
type: endpoint
last_updated: 2026-11-13
feature: email
related:
  - https://docs.corefinity.com/guides/sites/site-settings/outbound-email.md
  - https://docs.corefinity.com/mcp/tools/corestack_email_make_default.md
---
# Update the default sending domain

Makes a verified sending domain that the site already sends through the default: mail whose sender matches no
other sending domain then goes out through it. Answers the settings as they then read.

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

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 12 a minute
- Try it in the console: off. It has not been cleared for the console. 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 POST https://manage.corefinity.com/api/corestack/sites/1042/email/domains/mg.harbourandfinch.example.net/default \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

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

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

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

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/email/domains/mg.harbourandfinch.example.net/default', {
  method: 'POST',
  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.post(
    "https://manage.corefinity.com/api/corestack/sites/1042/email/domains/mg.harbourandfinch.example.net/default",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

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

## Responses

### 200 The email settings, with the new default first.

```json
{
  "add": {
    "allowed": true,
    "count": 2,
    "default_prefix": "mg",
    "max": 5,
    "reason": null
  },
  "cloudflare": {
    "can_write_records": false,
    "connected": true,
    "written_at": null,
    "zone": null
  },
  "default_domain": "mg.harbourandfinch.example.com",
  "domains": [
    {
      "active": true,
      "added_at": "2026-11-03T09:16:40Z",
      "added_by": "Daniel Reyes",
      "can_make_default": false,
      "can_remove": false,
      "can_rotate": true,
      "can_test": true,
      "cloudflare": {
        "can_write_records": false,
        "connected": true,
        "written_at": null,
        "zone": null
      },
      "error": null,
      "from_domain": "harbourandfinch.example.net",
      "id": 3101,
      "is_default": true,
      "last_checked_at": "2026-11-03T09:16:40Z",
      "last_test": null,
      "make_default_reason": null,
      "operation_id": 5120,
      "records": [
        {
          "cloudflare": null,
          "found": "v=spf1 include:mail.example.net ~all",
          "name": "mg.harbourandfinch.example.net",
          "priority": null,
          "purpose": "spf",
          "required": true,
          "state": "valid",
          "type": "TXT",
          "value": "v=spf1 include:mail.example.net ~all"
        },
        {
          "cloudflare": null,
          "found": "k=rsa; p=SYNTHETIC-DKIM-PUBLIC-KEY",
          "name": "pic._domainkey.mg.harbourandfinch.example.net",
          "priority": null,
          "purpose": "dkim",
          "required": true,
          "state": "valid",
          "type": "TXT",
          "value": "k=rsa; p=SYNTHETIC-DKIM-PUBLIC-KEY"
        },
        {
          "cloudflare": null,
          "found": "mxa.eu.mail.example.net",
          "name": "mg.harbourandfinch.example.net",
          "priority": 10,
          "purpose": "mx",
          "required": false,
          "state": "valid",
          "type": "MX",
          "value": "mxa.eu.mail.example.net"
        },
        {
          "cloudflare": null,
          "found": "mxb.eu.mail.example.net",
          "name": "mg.harbourandfinch.example.net",
          "priority": 10,
          "purpose": "mx",
          "required": false,
          "state": "valid",
          "type": "MX",
          "value": "mxb.eu.mail.example.net"
        },
        {
          "cloudflare": null,
          "found": "eu.mail.example.net",
          "name": "email.mg.harbourandfinch.example.net",
          "priority": null,
          "purpose": "tracking",
          "required": true,
          "state": "valid",
          "type": "CNAME",
          "value": "eu.mail.example.net"
        }
      ],
      "remove_reason": "The default can be removed once no other domain is left. Make another one the default first.",
      "sender": {
        "address": "noreply@harbourandfinch.example.net",
        "name": null
      },
      "sending_domain": "mg.harbourandfinch.example.net",
      "state": "verified",
      "state_label": "Verified",
      "test_reason": null,
      "verified_at": "2026-11-03T09:16:40Z"
    },
    {
      "active": true,
      "added_at": "2026-11-03T09:16:40Z",
      "added_by": "Daniel Reyes",
      "can_make_default": true,
      "can_remove": true,
      "can_rotate": true,
      "can_test": true,
      "cloudflare": {
        "can_write_records": true,
        "connected": true,
        "written_at": null,
        "zone": {
          "id": "example-zone-id",
          "name": "harbourandfinch.example.com"
        }
      },
      "error": null,
      "from_domain": "harbourandfinch.example.com",
      "id": 3102,
      "is_default": false,
      "last_checked_at": "2026-11-03T09:16:40Z",
      "last_test": null,
      "make_default_reason": null,
      "operation_id": 5121,
      "records": [
        {
          "cloudflare": null,
          "found": null,
          "name": "mg.harbourandfinch.example.com",
          "priority": null,
          "purpose": "spf",
          "required": true,
          "state": "missing",
          "type": "TXT",
          "value": "v=spf1 include:mail.example.net ~all"
        },
        {
          "cloudflare": null,
          "found": null,
          "name": "pic._domainkey.mg.harbourandfinch.example.com",
          "priority": null,
          "purpose": "dkim",
          "required": true,
          "state": "missing",
          "type": "TXT",
          "value": "k=rsa; p=SYNTHETIC-DKIM-PUBLIC-KEY"
        },
        {
          "cloudflare": null,
          "found": null,
          "name": "mg.harbourandfinch.example.com",
          "priority": 10,
          "purpose": "mx",
          "required": false,
          "state": "missing",
          "type": "MX",
          "value": "mxa.eu.mail.example.net"
        },
        {
          "cloudflare": null,
          "found": null,
          "name": "mg.harbourandfinch.example.com",
          "priority": 10,
          "purpose": "mx",
          "required": false,
          "state": "missing",
          "type": "MX",
          "value": "mxb.eu.mail.example.net"
        },
        {
          "cloudflare": null,
          "found": null,
          "name": "email.mg.harbourandfinch.example.com",
          "priority": null,
          "purpose": "tracking",
          "required": true,
          "state": "missing",
          "type": "CNAME",
          "value": "eu.mail.example.net"
        }
      ],
      "remove_reason": null,
      "sender": {
        "address": "noreply@harbourandfinch.example.com",
        "name": "Harbour & Finch"
      },
      "sending_domain": "mg.harbourandfinch.example.com",
      "state": "verified",
      "state_label": "Verified",
      "test_reason": null,
      "verified_at": "2026-11-03T09:16:40Z"
    }
  ],
  "error": null,
  "last_checked_at": "2026-11-03T09:16:40Z",
  "mailpit": null,
  "operation": null,
  "records": [
    {
      "cloudflare": null,
      "found": "v=spf1 include:mail.example.net ~all",
      "name": "mg.harbourandfinch.example.net",
      "priority": null,
      "purpose": "spf",
      "required": true,
      "state": "valid",
      "type": "TXT",
      "value": "v=spf1 include:mail.example.net ~all"
    },
    {
      "cloudflare": null,
      "found": "k=rsa; p=SYNTHETIC-DKIM-PUBLIC-KEY",
      "name": "pic._domainkey.mg.harbourandfinch.example.net",
      "priority": null,
      "purpose": "dkim",
      "required": true,
      "state": "valid",
      "type": "TXT",
      "value": "k=rsa; p=SYNTHETIC-DKIM-PUBLIC-KEY"
    },
    {
      "cloudflare": null,
      "found": "mxa.eu.mail.example.net",
      "name": "mg.harbourandfinch.example.net",
      "priority": 10,
      "purpose": "mx",
      "required": false,
      "state": "valid",
      "type": "MX",
      "value": "mxa.eu.mail.example.net"
    },
    {
      "cloudflare": null,
      "found": "mxb.eu.mail.example.net",
      "name": "mg.harbourandfinch.example.net",
      "priority": 10,
      "purpose": "mx",
      "required": false,
      "state": "valid",
      "type": "MX",
      "value": "mxb.eu.mail.example.net"
    },
    {
      "cloudflare": null,
      "found": "eu.mail.example.net",
      "name": "email.mg.harbourandfinch.example.net",
      "priority": null,
      "purpose": "tracking",
      "required": true,
      "state": "valid",
      "type": "CNAME",
      "value": "eu.mail.example.net"
    }
  ],
  "sender": {
    "address": "noreply@harbourandfinch.example.net",
    "name": null
  },
  "sending_domain": "mg.harbourandfinch.example.net",
  "state": "verified",
  "state_label": "Verified",
  "store_mapping": null,
  "test": {
    "last_sent_at": null,
    "last_to": null,
    "remaining_today": 20
  },
  "verified_at": "2026-11-03T09:16:40Z"
}
```

### 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 made the default. `reason` says why: `state` (it is the default already, it is not verified and in use yet, or an earlier change to the site's mail login did not finish), `busy` (another change is running), `upstream_unavailable` (the site's mail settings could not be written: nothing was changed, try again), `unavailable` (this environment does not send email itself), `restore_running`, `removed`, `deleted`, `provisioning` or `managed_elsewhere`.

```json
{
  "code": "state",
  "message": "This is already the default sending domain.",
  "reason": "state"
}
```

### 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 | `state` | What the request acts on is not in a state that allows this. Read the message. |
| 409 | `busy` | Another operation is running on the site. Wait for it to finish. |
| 409 | `managed_elsewhere` | This site is read-only here. Change it in the control panel that manages it. |
| 409 | `upstream_unavailable` | A service the action depends on did not answer. Try again later. |
| 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)
- MCP tool: [`corestack_email_make_default`](https://docs.corefinity.com/mcp/tools/corestack_email_make_default.md)
