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.
- Needs
execas well: The copied packages turn install scripts on for a package that does not run them on a target now.
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.
Body
eol when the version copied is past its end of life.
eolMust be true when a target is production. Defaults to false.
What to copy.
versionpackagesfollow_repositoryThe 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
Fields of each item
What this target refused. part names the part left out; it is null when the whole target refused.
At least 1.
Fields of each item
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. |
409 | managed_elsewhere | This site is read-only here. Change it in the control panel that manages it. |
422 | confirm | The action needs an explicit confirmation field. Ask the person, then send it. |
422 | copy_target_invalid | Node.js settings can only be copied to another environment of this site. |
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/node-runtime/apply-to \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"parts": [
"version",
"packages"
],
"targets": [
1043
]
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/node-runtime/apply-to', [
'parts' => [
'version',
'packages',
],
'targets' => [
1043,
],
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/node-runtime/apply-to', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
parts: [
'version',
'packages',
],
targets: [
1043,
],
}),
});
// 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/node-runtime/apply-to",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"parts": [
"version",
"packages",
],
"targets": [
1043,
],
},
)
data = res.json() if res.content else None{
"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": []
}
]
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "managed_elsewhere",
"message": "This site is managed by another control panel",
"reason": "managed_elsewhere"
}{
"code": "confirm",
"errors": {
"confirm_production": [
"Copying Node.js settings into production changes what it runs. Confirm to continue."
]
},
"message": "Copying Node.js settings into production changes what it runs. Confirm to continue.",
"reason": "confirm"
}{
"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 overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.