Update Folder (Rename)
Update Folder (Rename)
## Update Folder (Rename)
Renames an existing folder.
**Method:** `PUT`
**URL:** `{{base_url}}/folders/{{folder_id}}`
---
## Authentication
This endpoint requires authentication.
Use a **Bearer token** in the `Authorization` header:
```http
Authorization: Bearer {{access_token}}
```
---
## Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer {{access_token}} |
---
## Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| `folder_id` | integer | Yes | ID of the folder to rename |
Example endpoint:
```
{{base_url}}/folders/{{folder_id}}
```
---
## Required Variables
| Variable | Required | Description |
|---|---|---|
| `base_url` | Yes | Base API URL |
| `access_token` | Yes | Authentication access token |
| `folder_id` | Yes | Folder ID to update |
---
## Body (raw JSON)
Send the request body as **raw JSON**.
| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | New folder name |
Example body:
```json
{
"name": "Campaign Gallery"
}
```
---
## Sample Request
```bash
curl --request PUT "{{base_url}}/folders/{{folder_id}}" \
--header "Authorization: Bearer {{access_token}}" \
--header "Content-Type: application/json" \
--data '{
"name": "Campaign Gallery"
}'
```
---
## Sample Success Response
A successful request typically returns **HTTP 200 OK**.
```json
{
"success": true,
"message": "Folder renamed successfully",
"data": {
"id": 11,
"user_id": "43028",
"name": "Campaign Gallery",
"parent_id": 10,
"is_system": false,
"file_count": 0,
"created_at": "2026-03-10T06:25:32.000000Z",
"updated_at": "2026-03-10T06:27:25.000000Z",
"deleted_at": null
}
}
```
---
## Response Fields
| Field | Type | Description |
|---|---|---|
| `id` | integer | Folder ID |
| `user_id` | string | Owner user ID |
| `name` | string | Updated folder name |
| `parent_id` | integer/null | Parent folder ID |
| `is_system` | boolean | Indicates if the folder is a system folder |
| `file_count` | integer | Number of files inside the folder |
| `created_at` | datetime | Folder creation timestamp |
| `updated_at` | datetime | Last update timestamp |
| `deleted_at` | datetime/null | Soft delete timestamp |
---
## Common Errors
- **400 Bad Request**
- Missing `name`
- Invalid folder name
- **401 Unauthorized / 403 Forbidden**
- Missing or invalid `Authorization` header
- Expired `{{access_token}}`
- **404 Not Found**
- Folder does not exist
---
## Notes
- This endpoint **only renames the folder**; it does not change its location.
- Files and subfolders inside the folder remain unchanged.
- System folders (`is_system = true`) may not be renameable depending on permissions.
```
Request
This endpoint expects an object.
name
Response
OK
data
message
success
