{"uid":"cap_zLI7LUYNzL-uGD3ZyXyk4","slug":"host-withzero-ai-attach-custom-domain-to-hosted-site-slug-1c8723dd","name":"Attach Custom Domain to Hosted Site Slug","description":"Attach a custom domain (bought via domain-buy) to this slug. The caller must own both the slug and the domain. Calls Cloudflare to register the hostname as a Worker Custom Domain on the sites worker (SSL is auto-provisioned). Sub-paths on the custom domain serve the slug's index.html — single-file hosting model.","url":"https://host.withzero.ai/sites/:slug/domains?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z]{2,})+$","maxLength":253,"minLength":3,"description":"Fully-qualified domain to bind to this slug. Must be owned by caller via domain-buy."}},"additionalProperties":false},"responseSchema":{"type":"object"},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"proven_free","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"metered","summary":"metered — billed by usage","primary":{"kind":"metered","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"},"accepted":[{"kind":"metered","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"}]},"paymentMethods":[{"uid":"pm_abGxvfIDmLn9TZMJfnYpk","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":"host-site-post-sites-slug-domains:1"}],"brandName":"host.withzero.ai","brandSlug":"host-withzero-ai-mpp","brandBaseUrl":"https://host.withzero.ai","brandDocsUrl":null,"whatItDoes":"Binds a caller-owned custom domain (purchased via domain-buy) to a hosted site slug, registering it as a Cloudflare Worker Custom Domain with auto-provisioned SSL.","exampleAgentPrompt":"Attach the domain myportfolio.com to my withzero hosted site at slug 'my-portfolio' — I already bought the domain through domain-buy.","exampleUseCases":[{"title":"Portfolio site on personal domain","prompt":"I just uploaded my portfolio site to withzero under the slug 'alex-portfolio' and I bought alex-creates.com through domain-buy — can you attach that domain to the slug so my site is live at alex-creates.com?"},{"title":"Startup landing page on branded domain","prompt":"My startup's landing page is hosted at slug 'launchpad-v2' on withzero. I own startuplaunchpad.io from domain-buy. Please connect that domain to the slug so visitors can reach it at startuplaunchpad.io."},{"title":"Client site delivery on custom URL","prompt":"I finished building a site for my client and uploaded it to withzero as slug 'acme-landing'. They own acme-widgets.com which I bought via domain-buy — attach it to that slug so the client's site goes live on their domain."}],"resultDescription":"Returns a JSON object confirming the custom domain has been registered as a Cloudflare Worker Custom Domain on the site's worker. SSL is automatically provisioned by Cloudflare. Sub-paths on the custom domain will serve the slug's index.html.","failureModes":["Caller does not own the slug — authorization error","Caller does not own the domain in domain-buy — ownership verification failure","Domain format is invalid or doesn't match the required pattern — 400 validation error","Domain is already attached to another slug — conflict error","Cloudflare registration fails — upstream error from Cloudflare Worker Custom Domain API","Domain length exceeds 253 characters — schema validation error"],"whenToPreferThis":"Use this endpoint when you have already uploaded a static site to host.withzero.ai and want to serve it under your own branded domain that was purchased through the domain-buy service. This is the right call when you need Cloudflare-backed SSL auto-provisioning and want sub-paths on your custom domain to serve your single-file hosted site. Choose this over a generic DNS configuration when you are already within the withzero.ai hosting ecosystem.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T21:36:49.432Z","isFirstParty":true,"canonicalSlug":"host-withzero-ai-attach-custom-domain-to-hosted-site-slug-1c8723dd"}