Purge

Update time: 2026-07-28 19:05:04

Applicable Products

Content MGMT

API Description

Refresh the cached file content on CDN nodes. It generally takes effect within 1 - 3 minutes across the network. The daily limit for directory pushing per account and per domain name is 500.

Call frequency

Single user trigger frequency: 50/5min

Request parameter(s)

Body Params

NameDescription
urlsList
The set of URLs for which the cache needs to be cleared. Requirements for the URL format: The URL must start with 'http://' or 'https://'. Example input: http://www.a.com/image/test.png. The maximum length of each URL is 2000 characters. The domain name of each URL must be a domain name accelerated by our company. The number of refreshed URLs should not exceed 5000 per day (adjustable at the account level, contact technical support for adjustment). The total number of URLs and dirs in each API call should not exceed 500. Note: URLs and dirs cannot be both empty.
dirsList
The set of directories for which the cache needs to be cleared. Requirements for the dir format: It must start with 'http://domain name/' and end with '/'. For example, to refresh all files in the directory "test", the input format should be: http://www.a.com/test/. The maximum length of each directory is 1000 characters. The domain name of each directory must be a domain name accelerated by our company. Directory refresh has a default expiration, and directory deletion is not supported. The number of refreshed directories should not exceed 500 per day (adjustable at the account level, contact technical support for adjustment). Note: URLs and dirs cannot be both empty.
urlActionString
1) default: default value, the url cache is processed using the pre-configured operation type of domain. When no value is assigned to this element or the element is not submitted, the configuration of domain is read by default. 2) delete: ignore the operation type in the domain configuration, directly delete the cache file of the submitted url. 3) expire: Ignore the operation type in the domain configuration, and set the file with the cached commit url to expire. When there is a http access for the first time, a request is made to the origin server to check if the file is up-to-date. If the origin has a new file, the new version is directly pulled back from the source station and returned to the user. If there is no update, then the source station responds with http code 304, and the CDN provides the cache file in the edge node to the user.
dirActionString
It refers to the type of operation to clean up the dir cache, which is only valid for dirs elements. When no assignment or parameters are passed, the default channel configuration is selected. The optional values of this parameter are as follows: 1) default: default value, the dir cache is processed using the pre-configured operation type of domain. When no value is assigned to this element or the element is not submitted, the configuration of domain is read by default. 2) delete: ignore the type of operation in the channel configuration, delete the cache directory of the node directly. 3) expire: ignore the type of operation in the channel configuration, set the cached node to expire, when the first visit, check whether the directory of the source station is updated, when there is an update, retrieve the new version from the source station to return to the customer, and when there is no update, the source station responds 304, providing the cached directory of the node to the customer. Note: The use of directory delete function will result in all files cached in the directory empty, all files need to be retrieved, resulting in increased backsource bandwidth. Because of the high risk, the permission does not open by default. If you need to open this function, please contact the corresponding customer service technical support to apply for opening. Only the customer\'s account can be transferred to delete after opening.

Response parameter(s)

Body Params

NameDescription
CodeInteger
The status code of the task creation result: 1) 1 means success, 2) 0 means failure.
MessageString
Content system response message after submitting the task.
itemIdString
After calling the API once and submitting the task successfully, the content system will return an itemId. This ID is the unique identifier for each submission. You can use itemId to batch query the status (success/failure) of the task.

Error code

Error code(code)Description(message)HTTP statusSemantic
1Task submitted successfully200Task submitted successfully
0Null user name or user not enabled200Null user name or user not enabled
0Url and directories are not allowed to be null at the same time200Url and directories are not allowed to be null at the same time
0Total number of Url and directories exceeded limit (500)200Total number of Url and directories exceeded limit (500)
0User is not allowed to push200User is not allowed to push
0Wrong channel (partial error, correct url or dir will still execute)200Wrong channel (partial error, correct url or dir will still execute)
0unknown outlier200unknown outlier
0The task is being executed. Please do not submit the task repeatedly within 1 minute.200The task is being executed. Please do not submit the task repeatedly within 1 minute.
0parse json or xml error200parse json or xml error
0dir number reached the daily limit by domain200dir number reached the daily limit by domain

Example

JSON
XML
JSON
Request example
Copy Copy success
#!/bin/bash
username="username"
apiKey='apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.atomile.com/ccm/purge/ItemIdReceiver" \
-X "POST" \
-u "$username:$password" \
-H "Date:$date" \
-H "Content-Type: application/json" \
-d'{
    "urls": [
        "https://www.abc.com/test/test1.txt",
        "https://www.abc.com/test/test2.txt"
            ],
 "urlAction":"delete",
    "dirs": [
        "https://www.abc.com/test/",
        "https://www.abc.com/test2/"
            ],
     "dirAction":"expire"
}'
Response example
Copy Copy success
HTTP/1.1 200 OK
Content-Type: charset=utf-8; charset=UTF-8
x-cnc-request-id: 07d54dd4-a57b-46c9_1493594437418
Server: xxx
Content-Length: 81
{
   "Code":1,
   "Message":"handle success",
   "itemId":"64ec364dd81d4052a3534c1e86167950"
}