---
title: "Detach the publication"
method: DELETE
path: "/api/domains/{hostname}/attachment"
tags: ["Custom Domains"]
---

# Detach the publication

`DELETE /api/domains/{hostname}/attachment`

## Request

- Base URL: `https://brewpage.app`
- URL: `https://brewpage.app/api/domains/{hostname}/attachment`
- Auth: API key in header `X-Owner-Token`

Stops showing the publication on this hostname; the hostname stays in the profile with its slot and DNS state, ready to attach another one.

## Path parameters

- `hostname` string, required

## Headers

- `X-Owner-Token` unknown, required

## Response `204`

Detached, or nothing was attached

## Other responses

- `403`: Missing token, or ADMIN_TOKEN_REQUIRED: not an admin token of a profile; DOMAIN_NEEDS_ACCOUNT: the token is in no profile: sign in at https://account.brewpage.app/tokens, press Add existing token and paste it, then repeat; OWNER_TOKEN_REVOKED or OWNER_TOKEN_EXPIRED
- `404`: DOMAIN_NOT_FOUND: the hostname is not in this profile; FEATURE_DISABLED: custom domains are not available right now
- `429`: Rate limited: wait Retry-After (= retryAfterSeconds)

## Changes

- **2026-11-21** `19a6c5561e70`: 3 info
  - added the optional property `level` to the response with the `403` status
  - added the optional property `level` to the response with the `404` status
  - added the optional property `level` to the response with the `429` status
- **2026-11-11** `957711dab4b5`: 6 info
  - added the optional property `challengeUrl` to the response with the `403` status
  - added the optional property `challengeUrl` to the response with the `404` status
  - added the optional property `challengeUrl` to the response with the `429` status
  - added the optional property `siteKey` to the response with the `403` status
  - …2 more
- **2026-11-10** `e34e8877bb89`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/brewpage/apis/brewpage-api/changes/api/domains/:hostname/attachment/delete.md)

---

[API](https://skmtc.dev/brewpage/apis/brewpage-api.md) - [All operations](https://skmtc.dev/brewpage/apis/brewpage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/brewpage/apis/brewpage-api/revisions/78d2720a18a9?raw)
