Connect a purchased domain to your app
POST /v1/domain-purchases/:id/connect — provision on Domainee's edge + auto-set DNS in one call.
POST /v1/domain-purchases/:id/connect
After you've bought a domain (without autoConnect), call this to make it
actually serve traffic. Two things happen in one shot:
- The hostname is registered on Domainee's edge (POST /v1/domains is run server-side). TLS is minted on first request.
- The registrar's DNS is replaced with one CNAME →
edge.domainee.devso the domain starts proxying to your origin.
Request
curl -X POST https://api.domainee.dev/v1/domain-purchases/f8a0c1b9-…/connect \
-H "Authorization: Bearer $DOMAINEE_API_KEY" \
-d '{
"originUrl": "https://janesbakery.acmesites.app",
"keepHost": false
}'
Body parameters
| Field | Required | Default | Notes |
|---|---|---|---|
originUrl | ✅ | — | Where the edge proxies requests to. Must be https://. |
keepHost | false | true to forward the customer's original Host header to your origin. |
Response — 200 OK
Returns the purchase row with connectedDomainId now populated:
{
"purchase": {
"id": "f8a0c1b9-…",
"hostname": "janesbakery.com",
"status": "completed",
"connectedDomainId": "8f09b47c-b42f-4d14-…",
...
}
}
Use connectedDomainId to look up the connected domain via
GET /v1/domains/:id for status/cert/monitor
details.
Errors
| Code | Status | When |
|---|---|---|
not_found | 404 | Purchase doesn't exist (or belongs to another workspace). |
wrong_status | 409 | Purchase status isn't completed. Only connect a fully-registered domain. |
connect_failed | 502 | Edge provisioning failed (origin unreachable) or DNS update failed. Nothing was charged. |
When to use this vs. autoConnect
| Scenario | Use |
|---|---|
| You buy the domain and immediately connect it to your product | autoConnect on POST /v1/domain-purchases — one call. |
| You bought the domain a while ago, now want to connect (or reconnect to a different origin) | This endpoint. |
| You want to use the domain for something other than your app (email-only, parking, etc.) | Skip both. Manage DNS directly via PUT /:id/dns. |