pydo.cdn.create_endpoint()

Generated on 3 Aug 2026 from pydo version v0.40.0

Usage

client.cdn.create_endpoint(
    body={
        "origin": "static-images.nyc3.digitaloceanspaces.com",
        "ttl": 3600,
        "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf",
        ...,
    },
)
Returns JSONRaises HttpResponseError

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

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

custom_domain string optional

Example: static.example.com

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

created_at 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 os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

create_req = {"origin": "static-images.nyc3.digitaloceanspaces.com", "ttl": 3600}
create_resp = client.cdn.create_endpoint(create_req)

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.