> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.erlcrussia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom CDN domains

> How to connect your own domain to the team CDN.

A custom domain serves team files at addresses like `https://files.example.com/images/logo.png`. All domain operations need CDN management access in the team.

**1. Bind the key to the team**

Call `PUT /v3/cdn/team` with your `teamId`.

**2. Add the domain**

Call `POST /v3/cdn/custom-domains` with `{ "domain": "files.example.com", "s3Backup": true }`. The response contains the DNS records to verify.

**3. Set up DNS**

Add the records from the response at your registrar: a CNAME of the domain to `cname.erlcrussia.com` and the ownership record.

**4. Verify the domain**

Call `POST /v3/cdn/custom-domains/{id}/verify`. The domain is ready when `isVerified` is `true` and `cfSslStatus` is `active`.

**5. Upload a file**

Pass `domain=files.example.com` when uploading with `POST /v3/cdn/assets` and open the file on your domain.

## Management

* `PATCH /v3/cdn/custom-domains/{id}` changes the external file origin (`originUrl`) and backup (`s3Backup`). An empty `originUrl` disables the external origin.
* A domain with files cannot be deleted: delete the files first.
* The `deployHookToken` is used to [purge cache from CI/CD](https://apidocs.erlcrussia.com/en/tutorials/cdn-cache-purge-cicd.md). Keep it in CI secrets.
* If verification fails, check that the DNS records match the response and have propagated.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.