---
title: "Update a site's Node.js configuration"
url: https://docs.corefinity.com/api/reference/runtime/update-node-runtime
type: endpoint
last_updated: 2026-11-13
feature: node-runtime
related:
  - https://docs.corefinity.com/guides/sites/software-and-services/node-js.md
  - https://docs.corefinity.com/mcp/tools/corestack_node_version_change.md
---
# Update a site's Node.js configuration

Changes the Node.js version, the global packages or follow mode: send the `revision` of your last read and
what you change. A new package or a changed selector is pinned to the version it resolves to now on the public
npm registry. Answers `201` with the operation that applies the change, or `200` when nothing differs or only
follow mode changed. When the platform does not confirm the save, the `201` carries an operation that is still
`pending`: follow it, and do not send the change again meanwhile.

```http
PUT /api/corestack/sites/{site}/node-runtime
```

- Scope: `write`
- Also needs `exec` when The packages turn install scripts on (`scripts` is true) for a package that does not run them on that site now
- Two-factor: required on your account (all)
- Rate limit: 20 a minute
- Long-running: answers with an operation to poll
- Try it in the console: off. It runs commands on a live site. Copy the request and run it yourself when you are sure.

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.

## Body

- `acknowledge` (array of strings): `eol` for a version past its end of life.
- `apply` (string): When a change that needs a maintenance window is applied. `now` applies it at once. `tonight` queues it for the site's next window. `window` means the same as `tonight`. An endpoint that takes `window` only while maintenance windows are on for your company says so, and refuses it `422` on `apply` otherwise. One of `now`, `tonight`, `window`. Defaults to `now`.
- `follow_repository` (boolean)
- `keep_legacy_tools` (boolean): When leaving Node.js 16, keep the tools that came with it as packages. Defaults to `true`.
- `major` (integer): The Node.js version to move to. The packages are installed again for it at their pinned versions.
- `packages` (array of objects): The full list of global packages. A package left out is removed.
  - `name` (string, required): The package's name on the public npm registry, with its `@scope/` when it has one: lower-case letters, digits, `-`, `.`, `_` and `~`, at most 214 characters. Not a URL, a git or GitHub address, a file, a tarball or an npm alias. The name and the selector together are at most 255 bytes.
  - `scripts` (boolean): True to run the package's install scripts. Turning it on for a package that does not run them now needs the `exec` scope. Defaults to `false`.
  - `selector` (string): A version (`1.93.2`), a range written without spaces (`^1.90`, `>=1.2.0`, `1.x`, `1||2`) or a tag (`latest`), at most 64 characters. A range with a space in it, such as `>=1 <2`, is refused `package_spec_invalid`. Left out, the newest version is pinned.
- `revision` (integer, required): The `revision` of your last read.
- `update` (array of strings): Names of listed packages to look up again for a newer version within their selector.

## Request

### curl

```bash
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/node-runtime \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "follow_repository": true,
    "revision": 4
  }'
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->put('https://manage.corefinity.com/api/corestack/sites/1042/node-runtime', [
        'follow_repository' => true,
        'revision' => 4,
    ]);

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/node-runtime', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    follow_repository: true,
    revision: 4,
  }),
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.put(
    "https://manage.corefinity.com/api/corestack/sites/1042/node-runtime",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "follow_repository": True,
        "revision": 4,
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 Nothing differs, or only follow mode changed. `operation` is null.

```json
{
  "node_runtime": {
    "adopted": true,
    "adoption": {
      "adopt_now_refusal": null,
      "adopted": true,
      "can_adopt_now": false,
      "can_adopt_tonight": false,
      "in_progress": false,
      "planned_for": null,
      "queued_for": null,
      "revision": "v1"
    },
    "apply": {
      "error": null,
      "operation": null,
      "pending_tonight": null
    },
    "caches": null,
    "follow_repository": false,
    "last_applied_at": null,
    "limits": {
      "max_packages": 20
    },
    "locked": null,
    "major": 24,
    "memory": null,
    "options": [
      {
        "arrives_with": null,
        "available_on_this_row": true,
        "codename": "Krypton",
        "default_for_new": true,
        "end_of_life_on": "2028-04-30",
        "label": "Node.js 24",
        "major": 24,
        "needs_ack": [],
        "reason": null,
        "recommended": true,
        "selectable": true,
        "status": "maintenance_lts"
      },
      {
        "arrives_with": null,
        "available_on_this_row": true,
        "codename": "Jod",
        "default_for_new": false,
        "end_of_life_on": "2027-04-30",
        "label": "Node.js 22",
        "major": 22,
        "needs_ack": [],
        "reason": null,
        "recommended": false,
        "selectable": true,
        "status": "maintenance_lts"
      }
    ],
    "packages": [
      {
        "advisories": {
          "critical": 0,
          "high": 0
        },
        "bins": [],
        "error": null,
        "has_install_script": null,
        "installed_version": null,
        "latest": null,
        "name": "sass",
        "origin": "panel",
        "resolved": "1.93.2",
        "scripts": false,
        "selector": "latest",
        "state": "pending",
        "update_available": false,
        "wanted": null
      },
      {
        "advisories": {
          "critical": 0,
          "high": 0
        },
        "bins": [],
        "error": null,
        "has_install_script": null,
        "installed_version": null,
        "latest": null,
        "name": "sharp",
        "origin": "panel",
        "resolved": "0.34.4",
        "scripts": true,
        "selector": "0.34",
        "state": "pending",
        "update_available": false,
        "wanted": null
      }
    ],
    "repository": null,
    "revision": 4,
    "status": {
      "end_of_life_on": "2028-04-30",
      "key": "maintenance_lts",
      "label": "Maintenance LTS"
    },
    "unmanaged": [],
    "version": null
  },
  "operation": null,
  "warnings": [
    {
      "code": "already_newest",
      "message": "Already the newest that matches."
    }
  ]
}
```

### 201 The change started (`operation`), or was queued for the site's window (`queued`).

```json
{
  "item_id": 5120,
  "node_runtime": {
    "adopted": true,
    "adoption": {
      "adopt_now_refusal": null,
      "adopted": true,
      "can_adopt_now": false,
      "can_adopt_tonight": false,
      "in_progress": false,
      "planned_for": null,
      "queued_for": null,
      "revision": "v1"
    },
    "apply": {
      "error": null,
      "operation": null,
      "pending_tonight": {
        "item_id": 5120,
        "window_date": "2026-11-09"
      }
    },
    "caches": null,
    "follow_repository": false,
    "last_applied_at": null,
    "limits": {
      "max_packages": 20
    },
    "locked": null,
    "major": 24,
    "memory": null,
    "options": [
      {
        "arrives_with": null,
        "available_on_this_row": true,
        "codename": "Krypton",
        "default_for_new": true,
        "end_of_life_on": "2028-04-30",
        "label": "Node.js 24",
        "major": 24,
        "needs_ack": [],
        "reason": null,
        "recommended": true,
        "selectable": true,
        "status": "maintenance_lts"
      },
      {
        "arrives_with": null,
        "available_on_this_row": true,
        "codename": "Jod",
        "default_for_new": false,
        "end_of_life_on": "2027-04-30",
        "label": "Node.js 22",
        "major": 22,
        "needs_ack": [],
        "reason": null,
        "recommended": false,
        "selectable": true,
        "status": "maintenance_lts"
      }
    ],
    "packages": [
      {
        "advisories": {
          "critical": 0,
          "high": 0
        },
        "bins": [],
        "error": null,
        "has_install_script": null,
        "installed_version": null,
        "latest": null,
        "name": "sass",
        "origin": "panel",
        "resolved": "1.93.2",
        "scripts": false,
        "selector": "latest",
        "state": "pending",
        "update_available": false,
        "wanted": null
      },
      {
        "advisories": {
          "critical": 0,
          "high": 0
        },
        "bins": [],
        "error": null,
        "has_install_script": null,
        "installed_version": null,
        "latest": null,
        "name": "sharp",
        "origin": "panel",
        "resolved": "0.34.4",
        "scripts": true,
        "selector": "0.34",
        "state": "pending",
        "update_available": false,
        "wanted": null
      }
    ],
    "repository": null,
    "revision": 4,
    "status": {
      "end_of_life_on": "2028-04-30",
      "key": "maintenance_lts",
      "label": "Maintenance LTS"
    },
    "unmanaged": [],
    "version": null
  },
  "operation": null,
  "queued": true,
  "warnings": [],
  "window_date": "2026-11-09"
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), or your company requires two-factor authentication and you have not set it up. For routes outside Managed Clusters.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 The change cannot be made now. `reason` says why: `stale` (the configuration changed since your read), `busy`, `change_pending` (a change already waits for the window), `runtime_locked`, `runtime_not_adopted` (with the site's `adoption` state), `batch_window` (the change can only be made in the site's window: send it again with `apply` `tonight`), `conflict` (other changes kept landing first: send it again), `restore_running`, `command_running`, `deployment_running`, `cluster_paused`, `deleted`, `provisioning`, `removed` or `managed_elsewhere`. A site that cannot be changed from the Control Panel at all answers a `message` with no `reason`.

```json
{
  "code": "conflict",
  "message": "Other changes to the platform kept landing first, so nothing was saved. Retry it.",
  "reason": "conflict"
}
```

### 422 The change is not valid. `invalid_arguments` names the refused field in `errors`. `ack_required` asks for an acknowledgement (`required`, and the version in `detail`). `package_spec_invalid` refuses a name or selector that cannot be installed from the registry; its `code` says what is wrong with it, such as `spec_not_registry`. `package_unresolvable` means no version matches. `package_limit` and `package_duplicate` refuse the list. `scripts_memory` refuses install scripts where the command line has too little memory, with `packages`, `cli_memory_mib` and `min_cli_memory_mib`. `node_major_unavailable`, `node_major_existing_only` and `node_platform_minimum` refuse a version the site may not use. `feature_off` refuses `apply` `tonight` while queuing for the window is switched off.

```json
{
  "code": "ack_required",
  "detail": {
    "end_of_life_on": "2025-04-30",
    "major": 18
  },
  "message": "Node.js 18 reached its end of life on 30 April 2025 and gets no security fixes.",
  "reason": "ack_required",
  "required": [
    "eol"
  ]
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

### 502 The platform did not save the change. Nothing was changed; the body carries a `message` and no `reason`.

```json
{
  "message": "The change could not be saved. Contact support."
}
```

### 503 Corefinity has paused package changes for the moment (`switched_off`), or the npm registry could not be reached (`registry_unavailable`, with the `package`). Try again later.

```json
{
  "code": "switched_off",
  "message": "Global package changes are paused while commands are switched off. Try again later.",
  "reason": "switched_off"
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | 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 | `conflict` | The action conflicts with the object's present state. Read the message. |
| 409 | `runtime_locked` | Corefinity has locked this environment's Node.js settings. Contact support to change them. |
| 409 | `stale` | What you read has changed since you read it. Read it again, then send the change with its new version or quote. |
| 422 | `ack_required` | Node.js 18 reached its end of life on 30 April 2025 and gets no security fixes. |
| 422 | `scripts_memory` | Install scripts need more command-line memory than the environment has. Choose a larger size, or leave install scripts off. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |
| 502 |  | Read the message; it says what happened. |
| 503 | `switched_off` | Corefinity has switched this action off for the moment. Try again later. |

## The same task elsewhere

- Guide: [Node.js configuration](https://docs.corefinity.com/guides/sites/software-and-services/node-js.md)
- MCP tool: [`corestack_node_version_change`](https://docs.corefinity.com/mcp/tools/corestack_node_version_change.md)
