dots.v2.cdn.endpoints.byCdn_id().cache.delete()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.cdn.endpoints.byCdn_id(cdn_id).cache.delete(body: Purge_cache, requestConfiguration?: RequestConfiguration<object>): Promise<void>

Description

To purge cached content from a CDN endpoint, send a DELETE request to /v2/cdn/endpoints/{cdn_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.

Parameters

Path Parameters

cdn_id string required

Example: 19f06b6a-3ace-4315-b086-499a0e521b76

A unique identifier for a CDN endpoint.

Min: 1

Request Body

files array of strings required

Example: ["path/to/image.png", "path/to/css/*"]

An array of strings containing the path to the content to be purged from the CDN cache.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

await client.v2.cdn.endpoints
    .byCdn_id("19f06b6a-3ace-4315-b086-499a0e521b76").cache.delete({
    files: [
        "path/to/image.png",
        "path/to/css/*",
    ],
});

More Information

See /v2/cdn/endpoints/{cdn_id}/cache in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.