CorefinityCorefinityDocs
Open the Control PanelControl Panel
Varnish · 3 of 19

Update a site's Varnish switch

Switches Varnish on or off for a Magento 2 site. Switching on without version keeps the version the site had last while that version is still allowed for the site, and takes the site's default version (default_version) otherwise. The switch takes a few minutes: follow the operation in the answer. With apply set to tonight or window, the switch waits for the site's maintenance window.

PUT/api/corestack/sites/{site}/varnish

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

applystring

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. Defaults to now.

nowtonightwindow
Fields
enabledbooleanRequired
versionstring or null

The version to switch on with, such as 8.0.

Returns

202 The change started (operation), or waits for the site's window (queued: true). Follow a started change with the operation. Poll the operation until it finishes.

Fields of the 202 answer

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.
409busyAnother operation is running on the site. Wait for it to finish.
409image_not_offeredThe version this change needs is not available right now. Nothing was changed.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409memory_splitCorefinity staff have divided the environment's memory between its services by hand, and this change would undo that. Ask support to make the change.
409unchangedNothing would change. Nothing to do.
422feature_offThis feature is not on for your organisation yet.
422invalidFix the field named in field; errors says why.
422varnish_not_offeredVarnish is available for Magento 2 sites only. Nothing to change here.
422varnish_too_smallVarnish needs more memory than the package's cache share gives it. Choose a larger package, or switch RabbitMQ off.
422version_unsupportedThat Varnish version is not offered, or not available yet. Choose another version.
429rate_limitedWait for the seconds in Retry-After.
502upstream_unavailableA service the action depends on did not answer. Try again later.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/varnish \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
  }'
{
  "item_id": 77,
  "operation": null,
  "queued": true,
  "window_date": "2026-11-07"
}
Try it

Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT