---
title: "Copy page hierarchy"
method: POST
path: "/wiki/rest/api/content/{id}/pagehierarchy/copy"
tags: ["Content - children and descendants"]
---

# Copy page hierarchy

`POST /wiki/rest/api/content/{id}/pagehierarchy/copy`

Copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties, permissions and attachments.
 The id path parameter refers to the content id of the page to copy, and the new parent of this copied page is defined using the destinationPageId in the request body.
 The titleOptions object defines the rules of renaming page titles during the copy;
 for example, search and replace can be used in conjunction to rewrite the copied page titles.

 Response example:
 <pre><code>
 {
      "id" : "1180606",
      "links" : {
           "status" : "/rest/api/longtask/1180606"
      }
 }
 </code></pre>
 Use the /longtask/<taskId> REST API to get the copy task status.

## Path parameters

- `id` string, required

## Request body

- CopyPageHierarchyRequest
  - `copyAttachments` boolean — If set to `true`, attachments are copied to the destination page.
  - `copyPermissions` boolean — If set to `true`, page permissions are copied to the destination page.
  - `copyProperties` boolean — If set to `true`, content properties are copied to the destination page.
  - `copyLabels` boolean — If set to `true`, labels are copied to the destination page.
  - `copyCustomContents` boolean — If set to `true`, custom contents are copied to the destination page.
  - `copyDescendants` boolean — If set to `true`, descendants are copied to the destination page.
  - `destinationPageId` string, required
  - `titleOptions` CopyPageHierarchyTitleOptions — Required for copying page in the same space.
    - `prefix` string
    - `replace` string
    - `search` string

## Response `202`

Returns a full JSON representation of a long running task

- LongTask
  - `ari` string — the ARI for the long task, based on its ID
  - `id` string, required — a unique identifier for the long task
  - `links` object, required
    - `status` string — The URL to retrive status of long task.

## Other responses

- `400` — Returned if the title prefix is invalid (e.g. is empty, creates a conflict)
- `403` — Returned if the user does not have permission to create content at source and destination
- `404` — Returned if original page or destination page does not exist.

---

[API](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api.md) · [All operations](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/the-confluence-cloud-rest-api/revisions/70088490f406/schema)
