CorefinityCorefinityDocs
Open the Control PanelControl Panel
Node.js · 5 of 7

Copy Node.js configuration to other environments

Copies this site's Node.js version, packages or follow mode to other environments of the same site. The request is checked whole first, so a refusal applies nothing anywhere. Then each target is changed on its own: a part a target refuses is left out there while its other parts apply, and the other targets still go ahead.

POST/api/corestack/sites/{site}/node-runtime/apply-to
  • Needs exec as well: The copied packages turn install scripts on for a package that does not run them on a target now.

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

acknowledgearray of strings

eol when the version copied is past its end of life.

eol
confirm_productionboolean

Must be true when a target is production. Defaults to false.

partsarray of stringsRequired

What to copy.

versionpackagesfollow_repository
targetsarray of integersRequired

The ids of the environments to copy to, each once. Each must be another environment of this site that you may change. Up to 20 items.

Returns

200 One entry for each target, in the order asked.

Fields of the 200 answer
changesarray of objectsRequired
Fields of each item
operationobject or any or nullRequired
refusedobject or any or nullRequired

What this target refused. part names the part left out; it is null when the whole target refused.

site_idintegerRequired

At least 1.

warningsarray of objectsRequired
Fields of each item
codestringRequired
messagestringRequired

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.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
422confirmThe action needs an explicit confirmation field. Ask the person, then send it.
422copy_target_invalidNode.js settings can only be copied to another environment of this site.
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/node-runtime/apply-to \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [
      "version",
      "packages"
    ],
    "targets": [
      1043
    ]
  }'
{
  "changes": [
    {
      "operation": {
        "applied_at": null,
        "can_retry": false,
        "cluster": {
          "id": 1017,
          "name": "Northwind UK 1"
        },
        "committed_at": "2026-11-09T21:35:28Z",
        "completed_at": null,
        "created_at": "2026-11-09T21:35:28Z",
        "environment": {
          "env_id": "rs-northwind-harbourandfinch-example-com--staging",
          "hostname": "staging-harbourandfinch-example-com.northwind.cfstack.example.net",
          "id": 1043,
          "name": "Staging",
          "role": "staging",
          "role_label": "Staging",
          "slug": "staging"
        },
        "error": null,
        "failure_reason": null,
        "from_version": null,
        "hot": false,
        "id": 5121,
        "install": null,
        "label": "Sent to the site",
        "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": 1043
        },
        "status": "committed",
        "status_label": "Waiting for the platform",
        "step": "sent",
        "steps": [
          {
            "key": "saved",
            "label": "Saved",
            "state": "done"
          },
          {
            "key": "sent",
            "label": "Sent to the site",
            "state": "current"
          },
          {
            "key": "switched",
            "label": "Node.js switched",
            "state": "todo"
          },
          {
            "key": "checked",
            "label": "Checked",
            "state": "todo"
          }
        ],
        "subject": null,
        "summary": "Node.js configuration",
        "to_version": null,
        "type": "node_runtime",
        "type_label": "Node.js configuration"
      },
      "refused": null,
      "site_id": 1043,
      "warnings": []
    }
  ]
}
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