dots.v2.cdn.endpoints.post()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.cdn.endpoints.post(body: Cdn_endpoint, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | EndpointsPostResponse>

Description

To create a new CDN endpoint, send a POST request to /v2/cdn/endpoints. The origin attribute must be set to the fully qualified domain name (FQDN) of a DigitalOcean Space. Optionally, the TTL may be configured by setting the ttl attribute.

A custom subdomain may be configured by specifying the custom_domain and certificate_id attributes.

Parameters

id string optional read-only

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

A unique ID that can be used to identify and reference a CDN endpoint.

origin string required

Example: static-images.nyc3.digitaloceanspaces.com

The fully qualified domain name (FQDN) for the origin server which provides the content for the CDN. This is currently restricted to a Space.

endpoint string optional read-only

Example: static-images.nyc3.cdn.digitaloceanspaces.com

The fully qualified domain name (FQDN) from which the CDN-backed content is served.

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.

createdAt string optional read-only

Example: 2018-03-21T16:02:37Z

A time value given in ISO8601 combined date and time format that represents when the CDN endpoint was created.

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.post({
    origin: "static-images.nyc3.digitaloceanspaces.com",
    ttl: 3600,
});

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