v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_CDN Endpoints

Create a New CDN Endpoint

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.

post/v2/cdn/endpoints

Request body

idstring uuid

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

originstring hostname required

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

endpointstring hostname

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

ttl60 | 600 | 3600 | 86400 | 604800

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.

certificate_idstring uuid

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

custom_domainstring hostname

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

created_atstring date-time

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

Example request

{
  "id": "892071a0-bb95-49bc-8021-3afd67a210bf",
  "origin": "static-images.nyc3.digitaloceanspaces.com",
  "endpoint": "static-images.nyc3.cdn.digitaloceanspaces.com",
  "ttl": 3600,
  "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf",
  "custom_domain": "static.example.com",
  "created_at": "2018-03-21T16:02:37Z"
}

Response

The response will be a JSON object with an endpoint key. This will be set to an object containing the standard CDN endpoint attributes.

Example response

{
  "endpoint": {
    "id": "892071a0-bb95-49bc-8021-3afd67a210bf",
    "origin": "static-images.nyc3.digitaloceanspaces.com",
    "endpoint": "static-images.nyc3.cdn.digitaloceanspaces.com",
    "ttl": 3600,
    "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf",
    "custom_domain": "static.example.com",
    "created_at": "2018-03-21T16:02:37Z"
  }
}