CorefinityCorefinityDocs
Open the Control PanelControl Panel
Varnish · 7 of 19

Repair Magento's cache settings

Sets Magento's own cache settings to match the site's Varnish again, for when magento_config.state reads needs_repair. It runs a command on the site: follow it while its status is queued or running. A site takes six repairs an hour, whoever asks and from wherever. The endpoint is not found while site functions are off for the platform.

POST/api/corestack/sites/{site}/varnish/repair

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.

Returns

200 The repair finished within the request. command.status is succeeded or failed.

202 The repair is still running. Follow command.

Fields of the 200 answer
commandobjectRequired

A command on the site: a purge, or a repair of Magento's cache settings.

Fields
duration_msinteger or null
errorstring or null

Why it failed, in plain words.

exit_codeinteger or null
finished_atstring or null

Format: date-time.

idintegerRequired

At least 1.

inputobject or null

What was asked for. For a purge: its mode, the items it names and where the request came from (via). Null for a repair.

Fields
hoststring or null

The one host the purge was limited to, when it was.

include_queryboolean
modestring
alltagsurlspatterns
patternsarray of strings
tagsarray of strings
targetstring

Always varnish for a purge.

urlsarray of strings
viastring or null

Where the purge was asked for, such as api.

kindstringRequired
varnish_purgemagento_varnish_config
labelstringRequired
output_excerptstring or null
queued_atstring or null

Format: date-time.

requested_byany
resultobject or null

What the command did. For a purge: the requests sent, how many were needed (requests) and whether Varnish confirmed them. For a repair: the cache Magento was set up for (mode: varnish or builtin) and whether anything had to be changed. Null until it finishes.

Fields
changedboolean

For a repair: whether Magento's settings had to be changed.

confirmedboolean
countinteger

How many items the purge named; 1 for everything.

hostsarray of strings
modestring

For a purge, its mode. For a repair, varnish or builtin: the cache Magento's settings now name.

objectsinteger or null
requestsinteger
secondsnumber
sentinteger
targetstring
warningsarray of strings

Present only when the purge has something to warn about: a pattern broad enough to empty most of the cache, or an address too long to purge with its query variants, of which only the exact address was purged.

siteobject

A site by its id and domain.

Fields
domainstringRequired
idintegerRequired
started_atstring or null

Format: date-time.

statusstringRequired

queued or running while it runs, then succeeded or failed.

status_labelstring
Fields of the 202 answer
commandobjectRequired

A command on the site: a purge, or a repair of Magento's cache settings.

Fields
duration_msinteger or null
errorstring or null

Why it failed, in plain words.

exit_codeinteger or null
finished_atstring or null

Format: date-time.

idintegerRequired

At least 1.

inputobject or null

What was asked for. For a purge: its mode, the items it names and where the request came from (via). Null for a repair.

Fields
hoststring or null

The one host the purge was limited to, when it was.

include_queryboolean
modestring
alltagsurlspatterns
patternsarray of strings
tagsarray of strings
targetstring

Always varnish for a purge.

urlsarray of strings
viastring or null

Where the purge was asked for, such as api.

kindstringRequired
varnish_purgemagento_varnish_config
labelstringRequired
output_excerptstring or null
queued_atstring or null

Format: date-time.

requested_byany
resultobject or null

What the command did. For a purge: the requests sent, how many were needed (requests) and whether Varnish confirmed them. For a repair: the cache Magento was set up for (mode: varnish or builtin) and whether anything had to be changed. Null until it finishes.

Fields
changedboolean

For a repair: whether Magento's settings had to be changed.

confirmedboolean
countinteger

How many items the purge named; 1 for everything.

hostsarray of strings
modestring

For a purge, its mode. For a repair, varnish or builtin: the cache Magento's settings now name.

objectsinteger or null
requestsinteger
secondsnumber
sentinteger
targetstring
warningsarray of strings

Present only when the purge has something to warn about: a pattern broad enough to empty most of the cache, or an address too long to purge with its query variants, of which only the exact address was purged.

siteobject

A site by its id and domain.

Fields
domainstringRequired
idintegerRequired
started_atstring or null

Format: date-time.

statusstringRequired

queued or running while it runs, then succeeded or failed.

status_labelstring

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.
409command_runningAnother action or command is still running on the site. Wait for it to finish, then try again.
409exec_unresolvedAn earlier command on the site has not been confirmed stopped. Contact support.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409not_runningThe site, environment or deployment is not running. Read the message: where it can be started or will recover, start it or wait, then try again.
409wrong_platformThis is not available for the site's platform. Use it on a site of the platform it is for.
429rate_limitedWait for the seconds in Retry-After.
503switched_offCorefinity has switched this action off for the moment. 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/repair \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "command": {
    "blocked_until_verified": false,
    "duration_ms": 840,
    "error": null,
    "exit_code": 0,
    "finished_at": "2026-11-06T09:16:41Z",
    "id": 906,
    "input": null,
    "kind": "magento_varnish_config",
    "label": "Repair Magento cache settings",
    "operation_id": null,
    "output_excerpt": null,
    "queued_at": "2026-11-06T09:16:40Z",
    "requested_by": {
      "id": 2041,
      "name": "Eleanor Finch"
    },
    "result": {
      "changed": true,
      "mode": "varnish"
    },
    "site": {
      "domain": "harbourandfinch.example.com",
      "id": 1042
    },
    "started_at": "2026-11-06T09:16:40Z",
    "status": "succeeded",
    "status_label": "Done"
  }
}
Try it

Try it is off for this endpointIt runs commands on a live site. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT