DomaineeDocs

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:

  1. The hostname is registered on Domainee's edge (POST /v1/domains is run server-side). TLS is minted on first request.
  2. The registrar's DNS is replaced with one CNAME → edge.domainee.dev so 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

FieldRequiredDefaultNotes
originUrlWhere the edge proxies requests to. Must be https://.
keepHostfalsetrue 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

CodeStatusWhen
not_found404Purchase doesn't exist (or belongs to another workspace).
wrong_status409Purchase status isn't completed. Only connect a fully-registered domain.
connect_failed502Edge provisioning failed (origin unreachable) or DNS update failed. Nothing was charged.

When to use this vs. autoConnect

ScenarioUse
You buy the domain and immediately connect it to your productautoConnect 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.

On this page