CorefinityCorefinityDocs
Open the Control PanelControl Panel
Outbound email · 10 of 12

Rotate a sending domain's SMTP login

Gives the sending domain a new SMTP login, moves the site onto it and revokes the old one. The login is never answered: the site reads it itself. Beside the limit on changes, a person may start three rotations an hour.

POST/api/corestack/sites/{site}/email/rotate

Path parameters

siteintegerRequired

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.

Body

domainstring

A sending domain of the site, by its name or its id. Left out, the default.

Returns

201 The login is being rotated. Follow operation.id until it completes.

Fields of the 201 answer
emailobjectRequired

A site's email settings. The top-level fields describe the default sending domain.

Fields
addobjectRequired

Whether another sending domain can be added.

Fields
allowedbooleanRequired
countintegerRequired
default_prefixstringRequired
maxintegerRequired
reasonstring or nullRequired
cloudflareobject or any or nullRequired
default_domainstringRequired

The sending domain a set-up creates when it names none.

domainsarray of objectsRequired

Every sending domain of the site, the default first.

Fields of each item
activebooleanRequired

Whether the site sends through this domain now.

added_atstring or nullRequired

Format: date-time.

added_bystring or nullRequired
can_make_defaultbooleanRequired
can_removebooleanRequired
can_rotatebooleanRequired
can_testbooleanRequired
cloudflareobjectRequired

Whether the DNS endpoint can write this domain's records.

Fields
can_write_recordsbooleanRequired
connectedbooleanRequired

Whether your company has a connected Cloudflare account.

written_atstring or nullRequired

When the records were last written in full. Format: date-time.

zoneobject or any or nullRequired

The Cloudflare zone the domain is in, or null when it is in none of the connected account's.

errorstring or nullRequired
from_domainstringRequired

The domain of the sender addresses that go through it.

idintegerRequired

At least 1.

is_defaultbooleanRequired
last_checked_atstring or nullRequired

Format: date-time.

last_testobject or any or nullRequired

The last test email sent through this domain, or null.

make_default_reasonstring or nullRequired
operation_idinteger or nullRequired

The operation that set the domain up. At least 1.

recordsarray of objectsRequired
Fields of each item
cloudflareobject or any or nullRequired

The record as written in Cloudflare by the DNS endpoint. Null when it was not.

foundstring or nullRequired

What was found in DNS when it differs from value.

namestringRequired
priorityinteger or nullRequired

MX records only.

purposestringRequired

What the record is for, such as spf, dkim, mx, tracking or dmarc.

requiredbooleanRequired

False for the records sending works without (mx, dmarc).

statestringRequired
validuncheckedmismatchmissing
typestringRequired

The record type, such as TXT, CNAME or MX.

valuestringRequired
remove_reasonstring or nullRequired
senderobjectRequired
Fields
addressstringRequired

The address the site's email comes from.

namestring or nullRequired

The name shown beside it.

sending_domainstringRequired

The domain email is sent through, such as mg.harbourandfinch.example.com.

statestringRequired

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_dnsverifiedfailedremoving
state_labelstringRequired
test_reasonstring or nullRequired

Why a test cannot be sent, when it cannot.

verified_atstring or nullRequired

Format: date-time.

errorstring or nullRequired

What went wrong with the last set-up or DNS write, in plain words.

last_checked_atstring or nullRequired

Format: date-time.

mailpitobject or any or nullRequired

Where the email of a site that is not live is caught. Null on a live site.

operationobject or any or nullRequired

The email change that is running, or null.

recordsarray of objectsRequired
Fields of each item
cloudflareobject or any or nullRequired

The record as written in Cloudflare by the DNS endpoint. Null when it was not.

foundstring or nullRequired

What was found in DNS when it differs from value.

namestringRequired
priorityinteger or nullRequired

MX records only.

purposestringRequired

What the record is for, such as spf, dkim, mx, tracking or dmarc.

requiredbooleanRequired

False for the records sending works without (mx, dmarc).

statestringRequired
validuncheckedmismatchmissing
typestringRequired

The record type, such as TXT, CNAME or MX.

valuestringRequired
senderobject or any or nullRequired
sending_domainstring or nullRequired

The default sending domain, or null when none is set up.

statestringRequired

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_dnsverifiedfailedremoving
state_labelstringRequired
store_mappingobject or any or nullRequired

On 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.

testobjectRequired
Fields
last_sent_atstring or nullRequired

Format: date-time.

last_tostring or nullRequired
remaining_todayintegerRequired

How many test emails can still be sent today.

verified_atstring or nullRequired

Format: date-time.

operationobjectRequired

A change the Control Panel is making or has made. A save or an action that starts work answers one in operation; read it again by id with GET /corestack/operations/{operation} until status is completed or failed. Both answers have this shape; the few endpoints that answer a different one say so.

Fields
applied_atstring or null
can_retryboolean or null
clusterobject or any or null

The cluster the operation runs on.

committed_atstring or null
completed_atstring or nullRequired
created_atstring or nullRequired
environmentobject or any or null
errorstring or nullRequired

Why the operation failed, in plain words. Null unless status is failed.

failure_reasonstring or null

A stable code for the failure.

from_versionstring or null
hotboolean or null

True when the change applies without a maintenance window.

idintegerRequired
installobject or null
labelstring or null
notesarray of objects

What the operation did differently on purpose. Empty when nothing.

Fields of each item
codestringRequired
textstringRequired
parent_operation_idinteger or null
requested_byany

Who asked for the change.

reset_targetany

Present on some site creations and copies.

resultany

Always null here. A one-time result is read once with the reveal endpoint.

result_statestring
nonependingavailableviewed
retried_by_operation_idinteger or null
retries_operation_idinteger or null
retry_requiresany

What a retry needs first, if anything.

revealedany

Who revealed a one-time result and when, when there was one.

scopestringRequired
siteclusterbatch
siteobject or any or null

The website the operation belongs to. Null for a cluster's own operation.

statusstringRequired

Where a change is. completed and failed are final; every other status means the change is still running and blocks another change to the same site.

pendingcommittedrolling_outexecutingcompletedfailed
status_labelstringRequired
stepstring or null

The key of the step the operation is at. Null once it has completed.

stepsarray of objectsRequired
Fields of each item
keystring
labelstring
statestring

One of done, current, todo, failed or skipped.

subjectobject or null
summarystring or null
to_versionstring or null
typestringRequired

The kind of change, such as crons_change or redirects_change.

type_labelstringRequired

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
404tenant_mismatchThe object does not exist or the token may not see it. Check the id.
409busyAnother operation is running on the site. Wait for it to finish.
429rate_limitedWait 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/rotate \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "email": {
    "add": {
      "allowed": true,
      "count": 1,
      "default_prefix": "mg",
      "max": 5,
      "reason": null
    },
    "cloudflare": {
      "can_write_records": true,
      "connected": true,
      "written_at": null,
      "zone": {
        "id": "example-zone-id",
        "name": "harbourandfinch.example.com"
      }
    },
    "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": false,
        "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": 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": 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": {
      "id": 5122,
      "scope": "site",
      "status": "executing",
      "status_label": "Creating the new credential",
      "summary": "New SMTP credential for mg.harbourandfinch.example.com",
      "to_version": null,
      "type": "mail_rotate",
      "type_label": "Email credentials"
    },
    "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"
      }
    ],
    "sender": {
      "address": "[email protected]",
      "name": "Harbour & Finch"
    },
    "sending_domain": "mg.harbourandfinch.example.com",
    "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"
  },
  "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": 5122,
    "install": null,
    "label": "New credential created",
    "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": "Creating the new credential",
    "step": "credential",
    "steps": [
      {
        "key": "credential",
        "label": "New credential created",
        "state": "current"
      },
      {
        "key": "secret",
        "label": "Credentials stored",
        "state": "todo"
      },
      {
        "key": "restart_pending",
        "label": "Settings sent",
        "state": "todo"
      },
      {
        "key": "restarted",
        "label": "Settings applied",
        "state": "todo"
      },
      {
        "key": "verified",
        "label": "New login verified",
        "state": "todo"
      },
      {
        "key": "revoked",
        "label": "Old credentials revoked",
        "state": "todo"
      }
    ],
    "subject": null,
    "summary": "New SMTP credential for mg.harbourandfinch.example.com",
    "to_version": null,
    "type": "mail_rotate",
    "type_label": "Email credentials"
  }
}
Try it

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.

Was this helpful?
Open in ClaudeOpen in ChatGPT