# Copy A Folder

`POST /folders/{folderId}/copy`

Copies an accessible folder and its accessible subtree to the requested folder. Set `parentId` to `null` to copy it to the Markdawn root. The response reports whether restricted items were skipped.
## Authentication

Use one of the following authentication alternatives:

- **API token** (`bearerToken`) : Send a named API token in the Authorization header. Send it in the `Authorization: Bearer <token>` header.
- **Better Auth browser session** (`browserSession`) : Use the Better Auth session cookie from a signed-in browser session. Send it in the `better-auth.session_token` cookie.
## Token permissions

API tokens must include `pages:write`.
## Parameters

- `folderId` (path, required): The UUID of the folder.
## Request Body

Required.

### `application/json`

```json
{
  "parentId": null
}
```
## Responses

### 201

The copied folder ID and whether restricted items were skipped.


### `application/json`

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "skippedRestrictedItems": false
}
```

### 403

The API token is missing a required scope: pages:write.


### `application/json`

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```
