Update a site's Varnish switch by POST
The same switch as PUT /corestack/sites/{site}/varnish, kept for clients that send it as a POST. It takes the same body and answers the same.
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
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.
nowtonightwindowFields
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
| 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 | 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 | memory_split | Corefinity staff have divided the environment's memory between its services by hand, and this change would undo that. Ask support to make the change. |
409 | unchanged | Nothing would change. Nothing to do. |
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_too_small | Varnish needs more memory than the package's cache share gives it. Choose a larger package, or switch RabbitMQ off. |
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. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X POST 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
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/varnish', [
'enabled' => false,
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/varnish', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
enabled: false,
}),
});
// 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/varnish",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"enabled": False,
},
)
data = res.json() if res.content else None{
"item_id": 77,
"operation": null,
"queued": true,
"window_date": "2026-11-07"
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "busy",
"message": "Another change to this site is in progress. Wait for it to finish.",
"reason": "busy"
}{
"code": "feature_off",
"errors": {
"apply": [
"Queuing changes for the maintenance window is switched off at the moment"
]
},
"message": "Queuing changes for the maintenance window is switched off at the moment",
"reason": "feature_off"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"code": "upstream_unavailable",
"message": "The site's settings could not be read; try again shortly.",
"reason": "upstream_unavailable"
}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.