---
title: "Update a site's Varnish version"
url: https://docs.corefinity.com/api/reference/varnish/update-site-varnish-version
type: endpoint
last_updated: 2026-11-13
feature: varnish
related:
  - https://docs.corefinity.com/guides/sites/software-and-services/varnish.md
---
# Update a site's Varnish version

Moves the site to another Varnish version while Varnish is on. A version past its end of life needs `acknowledge: ["eol"]` and is refused `ack_required` without it. The site's custom VCL is compiled on the new version first; one that does not compile is refused `vcl_incompatible`. Follow the operation in the answer; with `apply` set to `tonight` or `window`, the change waits for the site's maintenance window.

```http
PUT /api/corestack/sites/{site}/varnish/version
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 10 a minute
- Long-running: answers with an operation to poll
- Try it in the console: off. It has not been cleared for the console. 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): What you accept about the version. `eol` for one past its end of life.
- `apply` (string): When the change is applied. Here `window` is always taken, and means the same as `tonight`. 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`.
- `version` (string, required): The version to move to, such as `8.0`. A refusal may name this field `to`, an older name for it.

## Request

### curl

```bash
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/varnish/version \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "acknowledge": [
      "eol"
    ],
    "version": "8.0"
  }'
```

### PHP

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

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->put('https://manage.corefinity.com/api/corestack/sites/1042/varnish/version', [
        'acknowledge' => [
            'eol',
        ],
        'version' => '8.0',
    ]);

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

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/varnish/version', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    acknowledge: [
      'eol',
    ],
    version: '8.0',
  }),
});

// 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/varnish/version",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "acknowledge": [
            "eol",
        ],
        "version": "8.0",
    },
)

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

## Responses

### 202 The change started (`operation`), or waits for the site's window (`queued: true`).

```json
{
  "item_id": 77,
  "operation": null,
  "queued": true,
  "window_date": "2026-11-07"
}
```

### 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), your company requires two-factor authentication and you have not set it up, or your account has no company that can use Managed Clusters, for example because the company was closed (`company_unavailable` or `company_not_enabled`, whichever the route checks first). For Managed Clusters routes; any other route uses `ForbiddenScopeOrTwoFactor`.

```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 was refused because of the site's state. `reason` says why: `unchanged` (the site is on that version already), `stale` (the site's Varnish changed since the choice was made: read it again), `busy`, `restore_running`, `deployment_running`, `command_running` or `snapshot_running` (other work on the site has not finished), `cluster_paused` (changes to the site's cluster are paused), `change_pending` (with `apply`: a change already waits for the window), `image_not_offered` (that version cannot be used at the moment), `conflict` (another change landed first: try again), `removed` or `managed_elsewhere`.

```json
{
  "code": "busy",
  "message": "Another change to this site is in progress. Wait for it to finish.",
  "reason": "busy"
}
```

### 422 A field is missing or wrong (`invalid`, with `field` and `errors`), or the change was refused for a reason of its own: `ack_required` (the version is past its end of life: `required` lists what `acknowledge` must carry and `detail` says why), `version_unsupported` (that version is not offered for the site), `varnish_off` (switch Varnish on first), `varnish_not_offered` (not a Magento 2 site), `vcl_incompatible` (the site's custom VCL does not compile on that version; `diagnostics` lists each problem), `unmanageable` (the site's Varnish version cannot be changed here: contact support) or `feature_off` when `apply` asks for a window and changes cannot wait for one at the moment.

```json
{
  "code": "ack_required",
  "detail": {
    "eol": "Varnish 8.0 no longer receives fixes from its upstream project; Corefinity keeps its image patched."
  },
  "message": "Confirm what this change does before it starts.",
  "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 site's settings could not be read, so nothing was changed (`upstream_unavailable`). Try again shortly.

```json
{
  "code": "upstream_unavailable",
  "message": "The site's settings could not be read; try again shortly.",
  "reason": "upstream_unavailable"
}
```

### 503 The site's custom VCL could not be checked against that version just now (`vcl_check_unavailable`), so nothing was changed. Try again in a minute.

```json
{
  "code": "vcl_check_unavailable",
  "message": "Your VCL could not be checked against Varnish 8.0 just now. Try again in a minute.",
  "reason": "vcl_check_unavailable"
}
```

## 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 | `busy` | Another operation is running on the site. Wait for it to finish. |
| 409 | `image_not_offered` | The version this change needs is not available right now. Nothing was changed. |
| 409 | `managed_elsewhere` | This site is read-only here. Change it in the control panel that manages it. |
| 409 | `unchanged` | Nothing would change. Nothing to do. |
| 422 | `ack_required` | Confirm what this change does before it starts. |
| 422 | `feature_off` | This feature is not on for your organisation yet. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 422 | `varnish_not_offered` | Varnish is available for Magento 2 sites only. Nothing to change here. |
| 422 | `varnish_off` | Varnish is off on the environment. Switch it on first. |
| 422 | `vcl_incompatible` | Your VCL does not compile on that Varnish version. Change the VCL first, or keep the version. |
| 422 | `version_unsupported` | That Varnish version is not offered, or not available yet. Choose another version. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |
| 502 | `upstream_unavailable` | A service the action depends on did not answer. Try again later. |
| 503 | `vcl_check_unavailable` | Your VCL could not be checked against Varnish 8.0 just now. Try again in a minute. |

## The same task elsewhere

- Guide: [Varnish](https://docs.corefinity.com/guides/sites/software-and-services/varnish.md)
