dots.v2.cdn.endpoints.byCdn_id().put()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.cdn.endpoints.byCdn_id(cdn_id).put(body: Update_endpoint, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | WithCdn_PutResponse>

Description

To update the TTL, certificate ID, or the FQDN of the custom subdomain for an existing CDN endpoint, send a PUT request to /v2/cdn/endpoints/{cdn_id}.

Parameters

Path Parameters

cdn_id string required

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

A unique identifier for a CDN endpoint.

Min: 1

Request Body

ttl integer optional

The amount of time the content is cached by the CDN's edge servers in seconds. TTL must be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when excluded.

One of: 60, 600, 3600, 86400, 604800

Default: 3600

certificateId string optional

Example: 892071a0-bb95-49bc-8021-3afd67a210bf

The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.

customDomain string optional

Example: static.example.com

The fully qualified domain name (FQDN) of the custom subdomain used with the CDN endpoint.

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);

const response = await client.v2.cdn.endpoints
    .byCdn_id("19f06b6a-3ace-4315-b086-499a0e521b76").put({
    ttl: 3600,
    certificateId: "892071a0-bb95-49bc-8021-3afd67a210bf",
    customDomain: "static.example.com",
});

Response Example

Show Response Example
{
  "endpoint": {
    "id": "19f06b6a-3ace-4315-b086-499a0e521b76",
    "origin": "static-images.nyc3.digitaloceanspaces.com",
    "endpoint": "static-images.nyc3.cdn.digitaloceanspaces.com",
    "created_at": "2018-07-19T15:04:16Z",
    "ttl": 3600
  }
}

More Information

See /v2/cdn/endpoints/{cdn_id} 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.