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.
Path parameters
The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.
A sending domain of the site, by its name (such as mg.harbourandfinch.example.net) or by its id in the email settings.
Returns
200 The email settings, with the new default first.
Fields of the 200 answer
Whether another sending domain can be added.
Fields
The sending domain a set-up creates when it names none.
Every sending domain of the site, the default first.
Fields of each item
Whether the site sends through this domain now.
Format: date-time.
Whether the DNS endpoint can write this domain's records.
Fields
Whether your company has a connected Cloudflare account.
When the records were last written in full. Format: date-time.
The Cloudflare zone the domain is in, or null when it is in none of the connected account's.
The domain of the sender addresses that go through it.
At least 1.
Format: date-time.
The last test email sent through this domain, or null.
The operation that set the domain up. At least 1.
Fields of each item
The record as written in Cloudflare by the DNS endpoint. Null when it was not.
What was found in DNS when it differs from value.
MX records only.
What the record is for, such as spf, dkim, mx, tracking or dmarc.
False for the records sending works without (mx, dmarc).
validuncheckedmismatchmissingThe record type, such as TXT, CNAME or MX.
Fields
The address the site's email comes from.
The name shown beside it.
The domain email is sent through, such as mg.harbourandfinch.example.com.
pending_dns: the domain exists and waits for its DNS records. preview: the site is not live, and its email is caught rather than sent.
previewnot_set_upcreatingpending_dnsverifiedfailedremovingWhy a test cannot be sent, when it cannot.
Format: date-time.
What went wrong with the last set-up or DNS write, in plain words.
Format: date-time.
Where the email of a site that is not live is caught. Null on a live site.
The email change that is running, or null.
Fields of each item
The record as written in Cloudflare by the DNS endpoint. Null when it was not.
What was found in DNS when it differs from value.
MX records only.
What the record is for, such as spf, dkim, mx, tracking or dmarc.
False for the records sending works without (mx, dmarc).
validuncheckedmismatchmissingThe record type, such as TXT, CNAME or MX.
The default sending domain, or null when none is set up.
pending_dns: the domain exists and waits for its DNS records. preview: the site is not live, and its email is caught rather than sent.
previewnot_set_upcreatingpending_dnsverifiedfailedremovingOn a live Magento 2 site with a sending domain, its stores' sender addresses and the sending domain each goes through, as last read on the site. Null otherwise, and until the first read has answered.
Fields
Format: date-time.
How many test emails can still be sent today.
Format: date-time.
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | 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. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
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"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();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);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{
"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": "[email protected]",
"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": "[email protected]",
"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": "[email protected]",
"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"
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "state",
"message": "This is already the default sending domain.",
"reason": "state"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.