---
title: "Remove a custom domain"
method: DELETE
path: "/websites/{websiteId}/domains/{domainId}"
tags: ["Domains"]
---

# Remove a custom domain

`DELETE /websites/{websiteId}/domains/{domainId}`

## Request

- Base URL: `https://api.cactal.ai/v1`
- URL: `https://api.cactal.ai/v1/websites/{websiteId}/domains/{domainId}`
- Auth: HTTP bearer

Deregisters the hostname from the Cactal edge and deletes the domain record. If the removed domain was primary, the oldest remaining active custom domain is promoted automatically. If edge deregistration fails, the domain stays in `removing` status and a background sweep retries until it is gone. Platform subdomains cannot be removed.

## Path parameters

- `websiteId` string, required
- `domainId` string, required

## Response `200`

Confirmation that the domain was removed.

- object
  - `removed` true, required: The domain record was deleted and the hostname deregistered from the Cactal edge.
  - `id` string, required: Id of the removed domain.
  - `hostname` string, required: Hostname that was removed.

## Other responses

- `400`: Validation failed. The response `message` names the first invalid field.
- `401`: Missing, invalid, expired, or revoked API key.
- `403`: The authenticated principal lacks the required capability.
- `404`: The resource does not exist or is outside the principal’s access scope.
- `429`: Rate limit exceeded. Retry after the number of seconds in the `Retry-After` header.

---

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