---
title: "Purge the Cache for an Existing CDN Endpoint"
method: DELETE
path: "/v2/cdn/endpoints/{cdn_id}/cache"
tags: ["DigitalOcean-public.v2-new_CDN Endpoints"]
---

# Purge the Cache for an Existing CDN Endpoint

`DELETE /v2/cdn/endpoints/{cdn_id}/cache`

To purge cached content from a CDN endpoint, send a DELETE request to
`/v2/cdn/endpoints/$ENDPOINT_ID/cache`. The body of the request should include
a `files` attribute containing a list of cached file paths to be purged. A
path may be for a single file or may contain a wildcard (`*`) to recursively
purge all files under a directory. When only a wildcard is provided, all cached 
files will be purged. There is a rate limit of 50 files per 20 seconds that can 
be purged. CDN endpoints have a rate limit of 5 requests per 10 seconds. 
Purging files using a wildcard path counts as a single request against the API's 
rate limit. Two identical purge requests cannot be sent at the same time.

## Path parameters

- `cdn_id` string, uuid, required

## Request body

- PurgeCache
  - `files` string[], required — An array of strings containing the path to the content to be purged from the CDN cache.

## Response `204`

The action was successful and the response body is empty.

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `404` — The resource was not found.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/revisions/cb3bf9b21459/schema)
