EmberlyEmberly Docs

Custom Domains API

Add, verify and manage your own domains for upload links.

Custom domains are available on embrly.ca and on instances running in cloud mode. See the Custom Domains guide for the DNS steps.

All endpoints need authentication. These endpoints return plain JSON or plain-text errors, without the success/data wrapper.

MethodEndpointDescription
GET/api/domainsList your domains and how many you can add
POST/api/domainsAdd a domain
POST/api/domains/{id}/cf-checkCheck DNS and verify the domain
POST/api/domains/{id}/cloudflare-setupCreate the DNS records in your own Cloudflare account
PATCH/api/domains/{id}Make it your main domain, or rename it
DELETE/api/domains/{id}Remove a domain

Add a Domain

POST /api/domains

{ "domain": "files.example.com" }

Returns the new domain as { "domain": { ... } }. It starts unverified.

StatusWhen
400Not a valid domain name
403You've reached your domain limit
409Someone has already added this domain

Verify a Domain

Point a CNAME record for your domain at cname.emberly.site, then call:

POST /api/domains/{id}/cf-check

Returns { "status": "...", "cf": { ... } } with the current verification and certificate state. Call it again until the domain shows as verified; this usually takes a few minutes after the DNS change. Limited to 10 checks per 10 minutes.

POST /api/domains/{id}/cloudflare-setup

If your domain is on Cloudflare, Emberly can create the records for you:

{
  "apiToken": "your-cloudflare-api-token",
  "replaceConflicts": false
}

The token needs Zone → Zone → Read and Zone → DNS → Edit permission for that domain. It's used once and not stored. Set replaceConflicts to true to replace existing records with the same name.


Manage a Domain

PATCH /api/domains/{id}

Make a verified domain the one your upload links use:

{ "action": "setPrimary" }

Rename a domain. It becomes unverified until you verify it again:

{ "action": "update", "domain": "cdn.example.com" }

DELETE /api/domains/{id}

Removes the domain. Links using it stop working.


List Your Domains

GET /api/domains

Returns your domains, with their verification state and whether each is your main domain, plus your domain limit.

On this page