Domains over the API
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.
| Method | Path | Does |
|---|---|---|
POST | /clients/{ref}/domains | Add { "domain": "go.bluecafe.example" }. Use 0 as {ref} for your own domain. |
GET | /domains | Every domain with its status. ?client= filters. |
GET | /domains/{id} | One domain. |
POST | /domains/{id}/check | Check 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" - Your customer types their domain in your app.
- Your app adds it with
POST /clients/{ref}/domains. - Show them the
dnsrecord from the answer, with copy buttons. - Wait for the
domain.livewebhook, or callPOST /domains/{id}/checkwhen they click “I’ve added it”. - Once
statusislive, they can make links on it with itsidasdomain_id.
Statuses#
status | Meaning | Show the owner |
|---|---|---|
unchecked | Just added | “Checking…” |
dns | The CNAME isn’t there yet | The record to add |
https | DNS works, the certificate is on its way | “Almost ready” |
live | DNS and HTTPS work | “Ready” |
problem | Something specific is wrong | status_detail |
Limits#
- The client’s
domain_limitapplies. Over it, adding a domain answers403. - 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
problemwith astatus_detailsaying every pull zone is full. See Pull zones and the domain limit. - A domain already used by another client answers
409.


