# Detach Custom Domain from Site Slug

> Detach Custom Domain from Site Slug is a paid API for AI agents from site.withzero.ai, paid per call via MPP, metered — billed by usage, status unknown (last checked 2026-10-02).

Removes a custom domain from a hosted site slug by deleting the KV mapping and tearing down the Cloudflare Worker Custom Domain attachment.

## Facts

- Endpoint: DELETE https://site.withzero.ai/sites/:slug/domains/:domain?utm_source=zero.xyz
- Price: metered — billed by usage
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Provider: site.withzero.ai
- Website: https://site.withzero.ai
- Canonical page: https://www.zero.xyz/c/site-withzero-ai-detach-custom-domain-from-site-slug-b684caab
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nEHurRSCQUrmHERAKVj7B

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability site-withzero-ai-detach-custom-domain-from-site-slug-b684caab -d '<json body>'
```

Example prompt: Detach the custom domain myblog.com from my site slug 'my-portfolio' on withzero — remove the domain mapping and tear down the Cloudflare attachment.

## When to prefer this

Use this endpoint when you need to remove a custom domain that was previously attached to a withzero.ai site slug, especially when switching domains, decommissioning sites, or cleaning up stale mappings. It is distinct from deleting the site itself and only removes the domain association.

## Known failure modes

- Caller is not the owner of the slug — returns authorization error
- Slug does not exist — returns not found error
- Domain was not attached to the slug — may return not found or no-op
- Cloudflare teardown fails mid-operation — partial state possible
- Invalid slug or domain format — returns validation error

## How this service works

Detach a custom domain from this slug. Owner-only. Removes the CUSTOM_DOMAINS KV mapping AND tears down the Cloudflare Worker Custom Domain attachment.

## Output

Returns a JSON object confirming that the custom domain has been detached from the slug — the CUSTOM_DOMAINS KV mapping is removed and the Cloudflare Worker Custom Domain attachment is torn down.

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/site-withzero-ai-detach-custom-domain-from-site-slug-b684caab/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from site.withzero.ai](https://www.zero.xyz/host/site.withzero.ai/llms.txt)
