CorefinityCorefinityDocs
Open the Control PanelControl Panel
Varnish · 15 of 19

Restore a VCL revision

Saves a revision's snippets again, as a new revision, and loads it like any save. It takes no body.

POST/api/corestack/sites/{site}/varnish/vcl/revisions/{number}/revert

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.

numberintegerRequired

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
appliedboolean

False, present when Varnish is off.

messagestring
operationobject or any or nullRequired

The change to follow. Null when nothing changed.

revisionobject or any or nullRequired

The new revision. Null when nothing changed.

varnish_offboolean

True when Varnish is off: the VCL loads when it is switched on.

warningsarray of objects

What the policy warns about in the saved snippets. A warning never stops the save.

Fields of each item
codestring

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.

columninteger or null
hookstring or null

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.

kindstringRequired

What found it: the policy (policy for an error, advice for a warning) or the compiler (compile).

policycompileadvice
lineinteger or null
messagestringRequired
severitystringRequired
errorwarning
sourcestring

What 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
appliedboolean

False, present when Varnish is off.

messagestring
operationobject or any or nullRequired

The change to follow. Null when nothing changed.

revisionobject or any or nullRequired

The new revision. Null when nothing changed.

varnish_offboolean

True when Varnish is off: the VCL loads when it is switched on.

warningsarray of objects

What the policy warns about in the saved snippets. A warning never stops the save.

Fields of each item
codestring

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.

columninteger or null
hookstring or null

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.

kindstringRequired

What found it: the policy (policy for an error, advice for a warning) or the compiler (compile).

policycompileadvice
lineinteger or null
messagestringRequired
severitystringRequired
errorwarning
sourcestring

What 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

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.
404not_foundThat revision does not exist.
409busyAnother operation is running on the site. Wait for it to finish.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409varnish_not_offeredVarnish is available for Magento 2 sites only. Nothing to change here.
409varnish_offVarnish is off on the environment. Switch it on first.
422vcl_invalidThe VCL breaks a rule of the platform. Nothing was saved. Fix what the message names.
422vcl_lockedCorefinity manages this environment's VCL. Contact support to change it.
429rate_limitedWait for the seconds in Retry-After.
503upstream_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 POST https://manage.corefinity.com/api/corestack/sites/1042/varnish/vcl/revisions/0/revert \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "operation": null,
  "revision": null
}
Try it

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.

Was this helpful?
Open in ClaudeOpen in ChatGPT