| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/api/resources/cache/methods/purge_environment | [Back] [Original] |
Purge cached content scoped to a specific environment. Supports the same purge types as the zone-level endpoint (purge everything, by URL, by tag, host, or prefix).
Please refer to purge cache availability and limits documentation page.
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYThe previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Cache PurgeFor more information on cache tags and purging by tags, please refer to purge by cache-tags documentation page.
For more information purging by hostnames, please refer to purge by hostname documentation page.
For more information on purging by prefixes, please refer to purge by prefix documentation page.
For more information, please refer to purge everything documentation page.
For more information on purging files, please refer to purge by single-file documentation page.
For more information on purging files with URL and headers, please refer to purge by single-file documentation page.
curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/environments/$ENVIRONMENT_ID/purge_cache \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"tags": [
"a-cache-tag",
"another-cache-tag"
]
}'{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"id": "023e105f4ecef8ad9ca31a8372d0c353"
}
}{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"id": "023e105f4ecef8ad9ca31a8372d0c353"
}
}| Web Proxy Viewer | New URL | Original Page |