Restore a VCL revision
Saves a revision's snippets again, as a new revision, and loads it like any save. It takes no body.
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.
A revision's number, from the list. The first is 0.
Returns
200 Nothing to follow: the VCL is what the site already has (revision and operation null), or Varnish is off, so the VCL was saved and loads when Varnish is switched on (varnish_off: true).
202 The VCL was saved and is being loaded, which takes about a minute. Follow operation: its vcl.outcome says whether Varnish loaded it. Poll the operation until it finishes.
Fields of the 200 answer
False, present when Varnish is off.
The change to follow. Null when nothing changed.
The new revision. Null when nothing changed.
True when Varnish is off: the VCL loads when it is switched on.
What the policy warns about in the saved snippets. A warning never stops the save.
Fields of each item
The policy's rule, such as VN-POL-09; the policy explains each. Left out of a finding of the compiler, which has no rule.
The snippet it is about (recv, backend_response or deliver), or * for the policy's limit on the snippets together. Empty for a finding of the compiler about the VCL as a whole, whose line and column are 0.
What found it: the policy (policy for an error, advice for a warning) or the compiler (compile).
policycompileadviceerrorwarningWhat found it, in words, such as the Varnish version the compile ran on. Left out of a finding of the policy.
Fields of the 202 answer
False, present when Varnish is off.
The change to follow. Null when nothing changed.
The new revision. Null when nothing changed.
True when Varnish is off: the VCL loads when it is switched on.
What the policy warns about in the saved snippets. A warning never stops the save.
Fields of each item
The policy's rule, such as VN-POL-09; the policy explains each. Left out of a finding of the compiler, which has no rule.
The snippet it is about (recv, backend_response or deliver), or * for the policy's limit on the snippets together. Empty for a finding of the compiler about the VCL as a whole, whose line and column are 0.
What found it: the policy (policy for an error, advice for a warning) or the compiler (compile).
policycompileadviceerrorwarningWhat found it, in words, such as the Varnish version the compile ran on. Left out of a finding of the policy.
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. |
404 | not_found | That revision does not exist. |
409 | busy | Another operation is running on the site. Wait for it to finish. |
409 | managed_elsewhere | This site is read-only here. Change it in the control panel that manages it. |
409 | varnish_not_offered | Varnish is available for Magento 2 sites only. Nothing to change here. |
409 | varnish_off | Varnish is off on the environment. Switch it on first. |
422 | vcl_invalid | The VCL breaks a rule of the platform. Nothing was saved. Fix what the message names. |
422 | vcl_locked | Corefinity manages this environment's VCL. Contact support to change it. |
429 | rate_limited | Wait for the seconds in Retry-After. |
503 | 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/vcl/revisions/0/revert \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json"use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/varnish/vcl/revisions/0/revert');
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/varnish/vcl/revisions/0/revert', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
},
});
// 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/vcl/revisions/0/revert",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
)
data = res.json() if res.content else None{
"operation": null,
"revision": null
}{
"operation": {
"applied_at": null,
"can_retry": false,
"cluster": {
"id": 1017,
"name": "Northwind UK 1"
},
"committed_at": "2026-11-06T09:16:40Z",
"completed_at": null,
"created_at": "2026-11-06T09:16:40Z",
"environment": {
"env_id": "rs-harbourandfinch-example-com",
"hostname": "harbourandfinch-example-com.northwind.cfstack.example.net",
"id": 1042,
"name": "Production",
"role": "production",
"role_label": "Production",
"slug": "production"
},
"error": null,
"failure_reason": null,
"from_version": null,
"hot": false,
"id": 5125,
"install": null,
"label": "Loaded by Varnish",
"notes": [],
"parent_operation_id": null,
"requested_by": {
"id": 2041,
"name": "Eleanor Finch"
},
"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": 1042
},
"status": "committed",
"status_label": "Waiting for the platform",
"step": "loaded",
"steps": [
{
"key": "policy",
"label": "Checked against the policy",
"state": "done"
},
{
"key": "compiled",
"label": "Compiled",
"state": "done"
},
{
"key": "loaded",
"label": "Loaded by Varnish",
"state": "current"
},
{
"key": "checked",
"label": "Checked",
"state": "todo"
}
],
"subject": null,
"summary": "Varnish VCL",
"to_version": null,
"type": "varnish_vcl_change",
"type_label": "Varnish VCL"
},
"revision": {
"number": 2,
"status": "saving"
},
"warnings": []
}{
"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": "vcl_invalid",
"diagnostics": [
{
"code": "VN-POL-09",
"column": 5,
"hook": "recv",
"kind": "policy",
"line": 1,
"message": "vcl_recv runs after the front's access control (HTTP authentication, the allow-list, maintenance), which judged the original URL and host: a snippet may not change req.url, the Host header or another routing header (X-Original-URL, X-Rewrite-URL, X-HTTP-Method-Override, X-HTTP-Method, X-Method-Override). Redirect with return (synth(301, \"...\")) instead.",
"severity": "error"
}
],
"message": "This VCL cannot be saved: fix the errors shown.",
"reason": "vcl_invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"code": "upstream_unavailable",
"message": "The environment's files could not be read. Try again in a minute.",
"reason": "upstream_unavailable"
}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.