CorefinityCorefinityDocs
Open the Control PanelControl Panel
Domains · 1 of 8

Attach a domain to a site

Takes the site or environment live on the hostnames you send. confirm_domain is the site's domain on production, or the domain you are attaching on any other environment, typed exactly. With point_dns the DNS records are written in your connected Cloudflare account before the attach starts, and each record written counts against your company's 60 Cloudflare changes an hour.

POST/api/corestack/sites/{site}/attach-domain

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

canonicalstringRequired
confirm_domainstringRequired

On production, the site's domain. On another environment, the canonical you are attaching. Typed exactly.

confirm_replacementsboolean

True to let point_dns replace DNS records that already exist. Defaults to false.

default_storeobject or any or null

The Magento store shown on the primary; omitted or null uses Magento's default.

hostsarray of stringsRequired

Up to 10 items.

pending_dnsboolean

True to attach before DNS points at the platform. Each hostname that does not point here yet needs the TXT record that proves it is yours; the refusal names the record and its value. Defaults to false.

point_dnsboolean

True to point DNS through your connected Cloudflare account. Cannot be sent with pending_dns. Defaults to false.

proxied_records_checkedboolean

True once you have checked in Cloudflare that the record of each hostname in the check's proxied_unconfirmed points at its expected_ip. Defaults to false.

serveobject

For each extra domain on Shopware or Magento 2, redirect or storefront. Each Magento storefront needs an entry in stores.

each name →redirectstorefront
storesobject

Magento 2 only. Every key is a hostname in hosts with serve set to storefront; every such hostname needs an entry. One base_url address can be chosen per website or store view.

wwwstring
wwwbare

Returns

201 The attach started. Follow it by id.

Fields of the 201 answer
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.
409already_attachedThe environment already has a domain. Change it under Domains instead.
409not_connectedThe outside account this needs is not connected for your company. Connect it first; the message names it.
422confirm_mismatchSend the confirmation exactly as the field named in field asks for it.
422confirm_replacementsExisting DNS records would be replaced. Confirm to continue.
422invalidFix the field named in field; errors says why.
422too_manyToo many DNS changes in one go. Point the hosts in two steps.
429rate_limitedWait for the seconds in Retry-After.
500noneRead the message; it says what happened.
502noneRead the message; it says what happened.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/attach-domain \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "canonical": "www.harbourandfinch.example.org",
    "confirm_domain": "harbourandfinch.example.org",
    "hosts": [
      "harbourandfinch.example.org",
      "www.harbourandfinch.example.org"
    ],
    "www": "www"
  }'
{
  "applied_at": null,
  "can_retry": false,
  "cluster": {
    "id": 1017,
    "name": "Northwind UK 1"
  },
  "committed_at": null,
  "completed_at": null,
  "created_at": "2026-11-06T09:16:41Z",
  "environment": {
    "env_id": "rs-harbourandfinch-example-org",
    "hostname": "example-org-example.cfstack.io",
    "id": 1042,
    "name": "Production",
    "role": "production",
    "role_label": "Production",
    "slug": "production"
  },
  "error": null,
  "failure_reason": null,
  "from_version": null,
  "hot": false,
  "id": 77142,
  "label": "Saved to the platform",
  "notes": [],
  "parent_operation_id": null,
  "requested_by": {
    "id": 5021,
    "name": "Eleanor Finch"
  },
  "result": null,
  "result_state": "none",
  "retried_by_operation_id": null,
  "retries_operation_id": null,
  "retry_requires": null,
  "scope": "site",
  "site": {
    "domain": "harbourandfinch.example.org",
    "id": 1042
  },
  "status": "pending",
  "status_label": "Saving change",
  "step": "committed",
  "steps": [
    {
      "key": "checks",
      "label": "DNS checked",
      "state": "done"
    },
    {
      "key": "committed",
      "label": "Saved to the platform",
      "state": "current"
    },
    {
      "key": "rolled",
      "label": "Change applied",
      "state": "todo"
    },
    {
      "key": "rewritten",
      "label": "Site URL updated",
      "state": "todo"
    },
    {
      "key": "certificate",
      "label": "Certificate issued",
      "state": "todo"
    },
    {
      "key": "live",
      "label": "Domain attached",
      "state": "todo"
    }
  ],
  "summary": "Attach www.harbourandfinch.example.org",
  "to_version": null,
  "type": "attach_domain",
  "type_label": "Attach domain"
}
Try it

Try it is off for this endpointIt overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT