> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/cdn/purge/purgeobjectcaches.md).

# PurgeObjectCaches

## 1. API Description

This interface is used to refresh file content on the nodes. The refreshed file caches will immediately become invalid, and new requests will fetch the latest files from the origin. It supports batch URL purging.

## 2. Request Parameters

The following request parameters list only includes the required parameters for the interface.

| Parameter Name | Required | Type            | Description                                                                                            |
| -------------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------ |
| objectType     | No       | String          | [Purge task type](https://docs.console.zenlayer.com/api-reference/cdn/datastructure.md#purgetypevalue) |
| objectPaths    | Yes      | Array of String | Files or directories to be purged.                                                                     |

## 3. Output Parameters

| Parameter Name | Type   | Description                                                                                 |
| -------------- | ------ | ------------------------------------------------------------------------------------------- |
| requestId      | String | Unique request ID, returned with each request. Provide this requestId when locating issues. |
| taskId         | String | Purge task Id                                                                               |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}

1. **Cache Purge**

```json
POST / HTTP/1.1
Host: console.zenlayer.com/api/v2/cdn
Content-Type: application/json
X-ZC-Action: PurgeObjectCaches
<Common Request Params>

Request:
{
  "objectType": "URL",
  "objectPaths": ["http://cdntest.zenlayer.com/dir/1.jpg", "http://cdntest.zenlayer.com/dir/2.jpg"]
}

Response:
{
  "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
  "response": {
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "taskId": "taskId-xxxxxx"
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Error Codes

The following includes error codes encountered in business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode.md).
