Purge By Prefix
Purge by Prefix lets you initiate a Purge or Update operation for all the files in a particular path.
This feature is supported for Media Delivery.
Resource URL
POST https://content-management.cqloud.com/api/v2/content-management/purges
Body Parameters
The purge request parameters are passed in the body of the API request. The body must be formatted as application/json.
{
"siteId": String,
"operationType": <PURGE | UPDATE>,
"groupingType": PREFIX,
"urlGroupingParams": [
{
"url": String
},
...
]
}
The "url" parameter specifies the full prefix of the files to be purged or updated.
The following example url would be used to execute the operation on all the files prefixed by /region_1/products/images/, as if the url value ended with a wildcard. (/region1/products/images*).
"url": "/region_1/products/images/"
However, while the wildcard rule applies to anything that follows the prefix, it does not apply to the beginning of the url. For example, using the url value "/products/images/" would not identify "/region_1/products/images/" as a match.
Purge by prefix is executed on all the hosts in the delivery service.
Example JSON payload for a Purge by Prefix operation:
{
"siteId": "123f6e6943f14700014be139",
"operationType": "UPDATE",
"groupingType": "PREFIX",
"urlGroupingParams": [
{
"url": "/region_1/products/images/"
},
{
"url": "/region_2/products/images/"
},
{
"url": "/region_3/products/images/"
},
{
"url": "/docs/en/v2/"
},
{
"url": "/dynamic/news/latest/"
},
]
}
Response Example:
{
"siteId": "123f6e6943f14700014be139",
"operationType": "UPDATE",
"groupingType": "PREFIX",
"urlGroupingParams": [
{
"url": "/region_1/products/images/",
"hostname": ""
},
{
"url": "/region_2/products/images/",
"hostname": ""
},
{
"url": "/region_3/products/images/",
"hostname": ""
},
{
"url": "/docs/en/v2/",
"hostname": ""
},
{
"url": "/dynamic/news/latest/",
"hostname": ""
}
],
"jobId": "176",
"username": "me@mycompany.com",
"ownerOrgId": "123456789:my-company",
"jobStatus": "SUCCESS",
"creationTimeMilli": 1705580470456
}