# Rename a folder

**Publié le** : 2026-05-08
**Catégorie** : Media & Files

## `PUT /media-folders/:id`

**Rename a folder**

Updates a folder's name.

Required permissions: `media.update`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes | Unique identifier |


### Request Body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | Display name. 1-255 characters |
| `parentId` | string \| null | No | Parent resource ID |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Unauthorized — invalid or missing API token |
| `403` | Forbidden — insufficient permissions |
| `404` | Not found |
| `422` | Validation error |


### Examples

```bash
curl -X PUT https://api.lynkow.com/v1/media-folders/f1a2b3c4-d5e6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Hero Banners"}'
```

### Response Example

```json
{
  "data": {
    "id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "name": "Hero Banners",
    "parentId": null,
    "mediaCount": 24,
    "createdAt": "2025-01-15T09:00:00.000Z",
    "updatedAt": "2025-04-06T12:00:00.000Z"
  }
}
```

---