---
title: "Remove a custom domain from a site"
method: DELETE
path: "/api/v1/sites/{slug}/custom-domains/{host}"
tags: ["Domains"]
---

# Remove a custom domain from a site

`DELETE /api/v1/sites/{slug}/custom-domains/{host}`

## Request

- Base URL: `https://api.dotsy.ai`
- URL: `https://api.dotsy.ai/api/v1/sites/{slug}/custom-domains/{host}`
- Auth: HTTP bearer

Disconnects the hostname and, for an external one, deletes its Cloudflare custom hostname and frees its slot. The site stops answering on that host. DNS records at the user's provider are not touched. Needs the site owner. Editors, viewers, guest tokens (`guest_requires_account`) and keys scoped to other sites are refused.

## Path parameters

- `slug` string, required
- `host` string, required

## Response `200`

Removed.

- RemoveCustomDomainResponse
  - `ok` true, required

## Other responses

- `400`: The host is not a valid hostname (`invalid_host`, `single_label_host`, `reserved_host`).
- `401`: Missing or invalid credentials.
- `403`: Not allowed: only the site owner manages domains, and guest tokens cannot.
- `404`: No such site (`site_not_found`), or that host is not on this site (`domain_not_found`).
- `503`: Custom domains are not configured on this server (`serving_unconfigured`).

---

[API](https://skmtc.dev/dotsy/apis/dotsy-api.md) · [All operations](https://skmtc.dev/dotsy/apis/dotsy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dotsy/apis/dotsy-api/revisions/4272ed3b85d7?raw)
