[ Web Proxy ]
URL:
Viewing: https://docs.digitalocean.com/reference/pydo/reference/cdn/update_endpoints/ [Back]  [Original]

pydo.cdn.update_endpoints() | DigitalOcean Documentation

For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).

pydo.cdn.update_endpoints()

Generated on 3 Aug 2026 from pydo version v0.40.0

Copy page as Markdown View page as Markdown

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.

In this article...


We can't find any results for your search.

Try using different keywords or simplifying your search terms.


Web Proxy Viewer  |  New URL  |  Original Page