N Docs
← Back to site

Domains over the API

2 min readUpdated November 23, 2026

Turn on Domains over the API under Settings > Developers first (and publish the edge script once). Until then these answer 503 domains_not_set_up. The edge script then adds each domain to one of your pull zones and asks Bunny for a free certificate, without WordPress.

MethodPathDoes
POST/clients/{ref}/domainsAdd { "domain": "go.bluecafe.example" }. Use 0 as {ref} for your own domain.
GET/domainsEvery domain with its status. ?client= filters.
GET/domains/{id}One domain.
POST/domains/{id}/checkCheck again, after the owner added the record.
DELETE/domains/{id}Remove it and free its place on the pull zone. Its links stay, and come back if it’s added again.

A domain whose DNS isn’t pointed yet:

{ "data": { "id": 4, "domain": "go.bluecafe.example", "client_id": 2, "is_primary": true, "status": "dns", "status_label": "Waiting for DNS", "status_detail": "Point a CNAME for go.bluecafe.example at nahnu-links.b-cdn.net, then check again.", "checked_at": 1795348913, "dns": { "type": "CNAME", "name": "go", "host": "go.bluecafe.example", "target": "nahnu-links.b-cdn.net" }, "created_at": 1795348913 } }

Show the owner the dns record. status is live (DNS and HTTPS work), dns, https, problem (see status_detail, for example when every pull zone is full) or unchecked. The domain.live webhook fires when it starts working, so you don’t need to poll.

The whole flow#

sequenceDiagram
  participant App as Your app
  participant API as Partner API
  participant Owner as Domain owner
  App->>API: POST /clients/ext:user_42/domains
  API-->>App: status "dns" + the CNAME record
  App->>Owner: Show the CNAME record
  Owner->>Owner: Adds it at their DNS provider
  API-->>App: webhook domain.live
  App->>Owner: "Your domain is ready"
  1. Your customer types their domain in your app.
  2. Your app adds it with POST /clients/{ref}/domains.
  3. Show them the dns record from the answer, with copy buttons.
  4. Wait for the domain.live webhook, or call POST /domains/{id}/check when they click “I’ve added it”.
  5. Once status is live, they can make links on it with its id as domain_id.

Statuses#

statusMeaningShow the owner
uncheckedJust added“Checking…”
dnsThe CNAME isn’t there yetThe record to add
httpsDNS works, the certificate is on its way“Almost ready”
liveDNS and HTTPS work“Ready”
problemSomething specific is wrongstatus_detail

Limits#

  • The client’s domain_limit applies. Over it, adding a domain answers 403.
  • Bunny allows 10 domains per pull zone at first. One support ticket to Bunny raises it to 100; until then, a domain that doesn’t fit shows problem with a status_detail saying every pull zone is full. See Pull zones and the domain limit.
  • A domain already used by another client answers 409.