Domains API
Manage custom domains for file uploads via the Emberly API.
Domain endpoints require a session cookie (authenticated browser session), not an upload token. These are used by the dashboard and not typically needed for external integrations.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/domains | List your domains |
POST | /api/domains | Add a new domain |
POST | /api/domains/[id]/cf-check | Trigger DNS verification |
PATCH | /api/domains/[id] | Update a domain (set primary etc.) |
DELETE | /api/domains/[id] | Remove a domain |
List Domains
GET /api/domains
Returns all your custom domains and your usage limits.
Response (200):
domainLimit.allowed = base + purchased + perkBonus
perkBonus comes from GitHub contributor and Discord booster perks.
Add a Domain
POST /api/domains
Responses:
| Status | Meaning |
|---|---|
200 | Domain created — add CNAME to verify |
400 | Invalid domain format |
403 | Domain slot limit reached |
409 | Domain already registered |
A new domain is created with cfStatus: "awaiting_cname". You must add a CNAME before verifying.
Verify a Domain
POST /api/domains/[id]/cf-check
Triggers a DNS check and Cloudflare provisioning attempt.
Responses:
| Status | Meaning |
|---|---|
202 | Verification started — check again in a moment |
200 | Verification complete — status field shows new state |
409 | CNAME missing or incorrect — expected field shows required target |
429 | Too many attempts (10 per 10 minutes) |
Update a Domain
PATCH /api/domains/[id]
Set as primary domain:
The domain must be verified before it can be set as primary.
Rename the domain:
Returns 204 No Content.
Delete a Domain
DELETE /api/domains/[id]
Returns 204 No Content. If the domain was primary, no domain becomes primary — you must set a new one.
Example: Full Setup Flow
See the Custom Domains user guide for full setup instructions including Cloudflare and DNS configuration.