# Rename a folder

`POST /folder.rename`

## Description

Rename a folder by ID.

**Access:** Organization and Personal. Personal tokens need the `admin` role
on the folder: a viewer gets `403` `access_denied`, and a folder the token's
owner does not belong to returns `404` `folder_not_found`. Organization
tokens can change every folder in the account.

**Required scope:** `folders:write`

---

**OpenAPI Spec:** [chat-v1.json](https://developer.ro.am/chat-v1.json)

## Authentication

```
Authorization: Bearer YOUR_API_KEY
```

## Request Body

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | string | Yes | Folder ID. |
| `name` | string | Yes | New folder name. Leading and trailing whitespace is trimmed. |

### Example Request

```json
{
  "id": "019a0000-0000-7000-8000-0000000000f1",
  "name": "Sales calls"
}
```

## Responses

### 200 - Folder renamed

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `ok` | "true" | Yes | Always `true` on success. See [Responses and Errors](/docs/guides/responses-and-errors). |
| `folder` | Folder | Yes |  |

**Folder**:

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | string | Yes | Folder ID. |
| `name` | string | Yes | Folder name. |
| `itemCount` | integer | Yes | Number of meetings and Magicasts filed in the folder. |
| `createdAt` | string | Yes | When the folder was created (RFC-3339). |
| `role` | "admin" | "viewer" | No | The caller's role. Present for Personal access only: `admin` is the folder owner, `viewer` can read. Omitted for Organization access.  |


#### Example Response

```json
{
  "ok": true,
  "folder": {
    "id": "019a0000-0000-7000-8000-0000000000f1",
    "name": "Sales calls",
    "itemCount": 2,
    "createdAt": "2026-01-21T18:30:00Z",
    "role": "admin"
  }
}
```

### 400 - Bad request. Common causes:
- Missing or invalid `id` (`missing_parameter` / `invalid_parameter`)
- Missing or empty `name` (`missing_parameter`), or longer than 255 characters
- Malformed JSON body or an unknown field (`invalid_json`)


### 401 - Presented invalid authentication credentials.

### 403 - Forbidden. Common causes:
- Token is missing `folders:write` (`missing_scope`)
- Personal token whose owner is a viewer, not an admin, of the folder (`access_denied`)


### 404 - Not found. Common causes:
- Folder not found, or not visible to the caller (`folder_not_found`)


### 405 - An unsupported method was requested.

### 500 - An internal error occurred.

---

*Machine-readable API documentation.*
*Full documentation: https://developer.ro.am/docs/api/folder-rename*
