pydo.cdn.create_endpoint()
Generated on 12 Dec 2025
from pydo version
v0.22.0
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.
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)More Information
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.