---
title: "Give one page its own copy of a shared section"
method: POST
path: "/api/v1/sites/{slug}/shared-sections/{name}/detach"
tags: ["Content"]
---

# Give one page its own copy of a shared section

`POST /api/v1/sites/{slug}/shared-sections/{name}/detach`

## Request

- Base URL: `https://api.dotsy.ai`
- URL: `https://api.dotsy.ai/api/v1/sites/{slug}/shared-sections/{name}/detach`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Replaces the page's reference with a copy of the section's HTML, so later edits to the section skip this page. Only for a page that places the section itself; a section from the layout is hidden on the page instead (placement `hide`). Staged as a draft.

## Path parameters

- `slug` string, required
- `name` string, required

## Request body

- DetachSharedSectionRequest
  - `pageKey` string, required: Content key of the page that gets its own copy, e.g. 'pricing.html'.
  - `ifMatch` string: The page's content hash. If the page changed since, nothing is written.
  - `dryRun` boolean: Report what would change; write nothing.

## Response `200`

Detached (staged as a draft), or what would change on a dry run.

- DetachSharedSectionResult
  - `name` string, required
  - `pageKey` string, required
  - `written` string[], required: Every content key this call staged (or, on a dry run, would stage): the section file, pages, the layout. Staged as a draft; in live publishing mode the dashboard then publishes exactly these keys.
  - `dryRun` boolean, required
  - `alreadyApplied` boolean, required
  - `eventId` string, nullable, required: The activity event of this change — undo with POST …/activity/{eventId}/revert. Null on a dry run, when nothing was written, or when the audit insert failed.

## Other responses

- `400`: The body is not valid.
- `401`: Missing or invalid credentials.
- `403`: The key or token cannot edit this site (viewer role, or AI access set to read only).
- `404`: No such site, page or section.
- `409`: The page changed since `ifMatch` (`shared_section_conflict`).
- `422`: The element or page can't take part (`not_eligible`, with `reason`), the selector matched 0 or 2+ elements (`unexpected_match_count`), or `selectors` don't sit next to each other in one parent, in page order (`not_siblings`).

---

[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)
