Purge a site's Cloudflare cache
Purges the whole zone, or up to 30 addresses on the site's own domains. The purge is sent to Cloudflare before the answer: the command in the answer says whether it succeeded or failed, and stays readable at GET /corestack/commands/{command}. When Varnish is on for the site its cache is purged first, unless varnish_first is false.
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
Addresses starting http:// or https:// on one of the site's own domains. Up to 30 items.
Whether to purge the site's Varnish cache first, when Varnish is on. Left out, it does.
Returns
202 The purge was sent. command.status is succeeded, with what was purged in result, or failed, with Cloudflare's refusal in error.
Fields of the 202 answer
The purge as a command. Read it again with GET /corestack/commands/{command}.
Fields
Format: date-time.
At least 1.
What was asked for: everything, or the urls.
Fields
Format: date-time.
Who asked for the purge. Null when that person's account no longer exists.
What the purge did, once it has finished.
The site.
Fields
At least 1.
Format: date-time.
queuedrunningsucceededfailedtimed_outlostIf 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 | no_zone | The site's domain is not in a connected Cloudflare zone, or Cloudflare is off for the site. Connect the Cloudflare account that holds the zone. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
503 | switched_off | Corefinity 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/cloudflare/purge \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"everything": true
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/cloudflare/purge', [
'everything' => true,
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/cloudflare/purge', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
everything: true,
}),
});
// 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/cloudflare/purge",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"everything": True,
},
)
data = res.json() if res.content else None{
"command": {
"blocked_until_verified": false,
"duration_ms": 547,
"error": "Cloudflare did not answer. Try again in a minute.",
"exit_code": null,
"finished_at": "2026-11-06T08:07:03Z",
"id": 2036,
"input": {
"everything": true
},
"kind": "cloudflare_purge",
"label": "Purge Cloudflare cache",
"operation_id": null,
"output_excerpt": null,
"queued_at": "2026-11-06T08:07:02Z",
"requested_by": {
"id": 5021,
"name": "Eleanor Finch"
},
"result": null,
"site": {
"domain": "harbourandfinch.example.com",
"id": 1042
},
"started_at": "2026-11-06T08:07:02Z",
"status": "failed",
"status_label": "Failed"
}
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "no_zone",
"message": "This site's domain is not in a connected Cloudflare zone",
"reason": "no_zone"
}{
"code": "invalid",
"errors": {
"urls": [
"Purge everything, or give 1–30 URLs on this site's addresses"
]
},
"field": "urls",
"message": "Purge everything, or give 1–30 URLs on this site's addresses",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many purges for this site. Try again in a few minutes.",
"reason": "rate_limited",
"retry_after_seconds": 3600
}{
"code": "switched_off",
"message": "Site commands are switched off at the moment",
"reason": "switched_off"
}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.