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
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | yes | The apex domain (e.g. brooksideplumbing.com). Don’t include https:// or trailing slash. |
include_www | boolean | no | Default 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.appIf 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.appThe 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
| Status | Error | Cause |
|---|---|---|
| 400 | invalid_domain | Domain string is malformed. |
| 402 | insufficient_credits | Account balance below the attach cost. |
| 402 | payment_method_required | Custom-domain attach requires a card on file for the $20/mo subscription. Add one in the dashboard. |
| 404 | site_not_found | No site with that ID belongs to your account. |
| 409 | domain_already_attached | Domain is attached to a different site (yours or someone else’s). |
| 424 | dns_not_configured | DNS check failed. Verify the records above and retry. |