API ReferencePOST /v1/sites/:id/domains

POST /v1/sites/:id/domains

Attach a domain you already own to a deployed site. Warpweb provisions an SSL cert (free via Cloudflare), updates routing, and serves the site at the new domain. The subdomain ({slug}.warpweb.app) keeps working as a fallback.

Attaching a custom domain promotes the site to the paid hosting tier: $20/site/month, always-on, no weekly refresh required. Stripe starts billing on successful attach.

Cost: ~50 credits ($0.50) one-time, plus $20/month per active paid site.

Request

curl -X POST https://api.warpweb.ai/v1/sites/site_8f3c2a1b/domains \
  -H "Authorization: Bearer wpwb_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "brooksideplumbing.com",
    "include_www": true
  }'

Body

FieldTypeRequiredDescription
domainstringyesThe apex domain (e.g. brooksideplumbing.com). Don’t include https:// or trailing slash.
include_wwwbooleannoDefault true. Also attach www.brooksideplumbing.com and redirect it to the apex.

DNS setup

Before calling this endpoint, point your domain’s DNS at Warpweb. At your registrar, add:

Type   Name   Value
CNAME  @      cname.warpweb.app
CNAME  www    cname.warpweb.app

If your registrar doesn’t support apex CNAMEs (most don’t), use:

Type   Name   Value
A      @      198.51.100.42
A      @      198.51.100.43
CNAME  www    cname.warpweb.app

The attach call validates DNS before charging. If DNS isn’t ready, you’ll get 424 dns_not_configured and no credits are deducted; fix DNS and retry.

If you don’t own a domain yet, use POST /v1/domains/register — Warpweb buys it, configures DNS, and attaches in one call.

Response

{
  "site_id": "site_8f3c2a1b-5d47-4c9e-b820-1f8a3e7d9c4f",
  "custom_domains": ["brooksideplumbing.com", "www.brooksideplumbing.com"],
  "hosting_tier": "paid_custom_domain",
  "ssl_status": "provisioning",
  "subscription_active": true,
  "deployed_url": "https://brooksideplumbing.com"
}

SSL provisioning typically completes within 60 seconds. Until it does, the site is reachable at the new domain over HTTP and at the subdomain over HTTPS.

Errors

StatusErrorCause
400invalid_domainDomain string is malformed.
402insufficient_creditsAccount balance below the attach cost.
402payment_method_requiredCustom-domain attach requires a card on file for the $20/mo subscription. Add one in the dashboard.
404site_not_foundNo site with that ID belongs to your account.
409domain_already_attachedDomain is attached to a different site (yours or someone else’s).
424dns_not_configuredDNS check failed. Verify the records above and retry.