# Rename or move a document folder

Change a folder's name, its parent, or its position. An absent field is left alone; parentFolderId sent as null moves the folder to the record's Documents root. A folder cannot be moved inside its own subtree.

Access class: `def:read`.

## Endpoint

`PATCH /v1/definitions/{key}/rows/{rowId}/folders/{folderId}`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| rowId | path | string | Yes |
| folderId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {},
  "params": {
    ":folderId": "",
    ":key": "string",
    ":rowId": ""
  },
  "query": {}
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "createdAt": "string",
    "createdByUserId": 1,
    "fileCount": 1,
    "folderCount": 1,
    "id": "",
    "name": "string",
    "parentFolderId": "",
    "position": 1,
    "updatedAt": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
