---
title: "Create a New CDN Endpoint"
method: POST
path: "/v2/cdn/endpoints"
tags: ["DigitalOcean-public.v2-new_CDN Endpoints"]
---

# Create a New CDN Endpoint

`POST /v2/cdn/endpoints`

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 body

- CdnEndpoint
  - `id` string, uuid — A unique ID that can be used to identify and reference a CDN endpoint.
  - `origin` string, 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.
  - `endpoint` string, hostname — The fully qualified domain name (FQDN) from which the CDN-backed content is served.
  - `ttl` 60 | 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_id` string, uuid — The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
  - `custom_domain` string, hostname — The fully qualified domain name (FQDN) of the custom subdomain used with the CDN endpoint.
  - `created_at` string, date-time — A time value given in ISO8601 combined date and time format that represents when the CDN endpoint was created.

## Response `201`

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

- object
  - `endpoint` CdnEndpoint
    - `id` string, uuid — A unique ID that can be used to identify and reference a CDN endpoint.
    - `origin` string, 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.
    - `endpoint` string, hostname — The fully qualified domain name (FQDN) from which the CDN-backed content is served.
    - `ttl` 60 | 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_id` string, uuid — The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
    - `custom_domain` string, hostname — The fully qualified domain name (FQDN) of the custom subdomain used with the CDN endpoint.
    - `created_at` string, date-time — A time value given in ISO8601 combined date and time format that represents when the CDN endpoint was created.

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/revisions/cb3bf9b21459/schema)
