CorefinityCorefinityDocs
Open the Control PanelControl Panel
Varnish · 6 of 19

Purge a site's Varnish cache

Removes pages from the site's Varnish cache: everything, the pages carrying a Magento cache tag, single addresses, or every address matching a pattern. A site may ask for ten purges an hour; Magento's own purges and deployments are not counted. host limits a purge by address or by pattern to one of the site's hostnames; a purge of everything or by tag always covers every hostname. Follow the command in the answer.

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

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

The body is application/json. The request example shows its shape.

Returns

202 The purge was sent. command.status says how it went.

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.
409command_runningAnother action or command is still running on the site. Wait for it to finish, then try again.
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.
422host_not_ownedA URL names a host that is not one of the site's. Purge only the site's own hosts.
422invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
422invalid_tagsA cache tag is not one. Send tags as the site sets them.
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/purge \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "host": null,
    "include_query": false,
    "mode": "urls",
    "urls": [
      "/gravel-bikes",
      "/gravel-bikes?colour=red"
    ]
  }'
{
  "command": {
    "blocked_until_verified": false,
    "duration_ms": 840,
    "error": null,
    "exit_code": 0,
    "finished_at": "2026-11-06T09:16:41Z",
    "id": 905,
    "input": {
      "host": null,
      "mode": "tags",
      "tags": [
        "cat_p_1180",
        "cat_c_27"
      ],
      "target": "varnish",
      "via": "api"
    },
    "kind": "varnish_purge",
    "label": "Varnish purged · by tag",
    "operation_id": null,
    "output_excerpt": "200",
    "queued_at": "2026-11-06T09:16:40Z",
    "requested_by": {
      "id": 2041,
      "name": "Eleanor Finch"
    },
    "result": {
      "confirmed": true,
      "count": 2,
      "hosts": [],
      "mode": "tags",
      "objects": null,
      "requests": 1,
      "seconds": 0,
      "sent": 1,
      "target": "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 deletes 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