---
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.

## Changes

- **2025-10-16** `cb3bf9b21459` — 2 info
  - api tag `DigitalOcean-public.v2-new_CDN Endpoints` added
  - api tag `CDN Endpoints` removed
- **2025-07-18** `f8e8c290636c` — 1 info
  - endpoint added
- **2025-07-17** `5fc9af728e82` — 1 breaking
  - api path removed without deprecation
- **2025-07-17** `f8e8c290636c` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/digitalocean/apis/digitalocean-api/changes/v2/cdn/endpoints/:cdn_id/cache/delete.md)

---

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