pydo.cdn.update_endpoints()

Generated on 8 May 2026 from pydo version v0.34.0

Usage

client.cdn.update_endpoints(
    cdn_id="19f06b6a-3ace-4315-b086-499a0e521b76",
    body={
        "ttl": 3600,
        "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf",
        "custom_domain": "static.example.com",
    },
)
Returns JSONRaises HttpResponseError

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

cdn_id string required

A unique identifier for a CDN endpoint.

Min: 1

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.

Request Sample

Show Request Sample
import os
from pydo import Client

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

update_req = {
    "ttl": 3600,
    "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf",
    "custom_domain": "static.example.com",
}

update_resp = client.cdn.update_endpoints("19f06b6a", update_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/{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.