Purge cache via URL or cache keys
const url = 'https://dashboard.quantcdn.io/api/v2/organizations/test-org/projects/test-project/purge';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"cache_keys":["example"],"urls":["example"],"scope":"project","soft":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dashboard.quantcdn.io/api/v2/organizations/test-org/projects/test-project/purge \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "cache_keys": [ "example" ], "urls": [ "example" ], "scope": "project", "soft": true }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization identifier
Example
test-orgProject identifier
Example
test-projectRequest Bodyrequired
Section titled “Request Bodyrequired”Send cache_keys, urls, or both. At least one of them must be non-empty.
object
Cache keys to purge. Optional when urls is set.
URL paths to purge, each starting with a slash (for example /contact). Use /* to purge the whole project. At most 100 per request; a single string is also accepted. The whole list is validated before any purge is sent. Optional when cache_keys is set.
Purge scope for cache_keys (project or org). Not used for urls.
Soft purge: mark cached content stale instead of removing it. When omitted, the purge is soft (true). Send false for a hard purge.
Responses
Section titled “Responses”The purge was accepted.
object
Example
{ "status": "okay"}Invalid request: no urls or cache_keys, an invalid scope, more than 100 URLs, or a URL that is not a string path starting with a slash. Nothing is purged.
object
Error message
Error flag
Example
{ "message": "The requested resource was not found", "error": true}Access is forbidden.
object
Error message
Error flag
Example
{ "message": "The requested resource was not found", "error": true}The content API did not accept the purge for one or more URLs. The message names those paths; the other URLs were purged.
object
Error message
Error flag
Example
{ "message": "The requested resource was not found", "error": true}