Skip to content

Clear the zone cache

POST
/api/zones/{zoneId}/cache/clear

Clears cached content for the zone. Set action to all to clear the whole zone cache, tag to clear all entries matching the given tags, uri to clear a single URI (requires hostname and uri), or html, images or assets to clear all cached content of that class across the zone. When the zone serves content through the CDN, the matching CDN cache is purged as well; cdnCleared reports whether that happened. Limited to one request per zone every 5 seconds; further requests are rejected with 429 Too Many Requests and a Retry-After header. Because of this strict limit, the endpoint is not suited for routine, application-driven cache invalidation. See the cache invalidation guide for the preferred approaches.

Authorizations

ApiToken

Long-lived API token created via POST /api/api-tokens (returned once in plaintext). A token created with readOnly may only perform safe requests (GET, HEAD, OPTIONS); write requests are rejected on every endpoint.

Type
API Key (header: X-API-TOKEN)
or
JWT

JWT access token obtained via POST /api/auth/login. Send as: Authorization: Bearer .

Type
HTTP (bearer)

Parameters

Path Parameters

zoneId*

Zone identifier

Type
string
Required

Request Body

JSON
{
  
"action": "all",
  
"tags": [
  
],
  
"uri": "/products/12",
  
"hostname": "www.example.com"
}

Responses

cache-clear resource created

JSON
{
  
"@context": "string",
  
"@id": "string",
  
"@type": "string",
  
"action": "all",
  
"cacheCleared": false,
  
"cdnCleared": false
}

Playground

Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI