---
title: "Enable or disable custom domains"
method: POST
path: "/websites/{websiteId}/domains/enablement"
tags: ["Domains"]
---

# Enable or disable custom domains

`POST /websites/{websiteId}/domains/enablement`

## Request

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

Turns custom domains on or off for the website — the billing moment. Enabling makes it a billable site on the plan (first included with Pro, additional sites charged per site, prorated); disabling stops that charge with a prorated credit and disconnects every custom domain on the website. Owner-only. When `paymentUrl` is returned nothing changed: complete checkout there, then call again. With `allowPurchase: false`, enabling fails with 409 `purchase_required` instead of adding a charge. Trashing a website disables custom domains automatically.

## Path parameters

- `websiteId` string, required

## Request body

- object
  - `enabled` boolean, required
  - `successUrl` string
  - `allowPurchase` boolean

## Response `200`

The enablement state after the call.

- object
  - `enabled` boolean, required: Whether custom domains are enabled for the website after this call.
  - `paymentUrl` string, nullable, required: Hosted checkout URL when enabling needs a payment step; custom domains stay disabled until checkout completes and the call is retried. `null` when applied directly.

## 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.
- `409`: The request conflicts with the current state of the resource.
- `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)
