> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.me-mate.net/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.me-mate.net/_mcp/server.

# Update Folder (Rename)

PUT https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D
Content-Type: application/json

## 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.

```
```

Reference: https://apidocs.me-mate.net/business-me-mate-net-ap-is-document-v-1-0/messenger-mate-gallery-app-file-upload-folder-management-api/folder-management-ap-is/update-folder-rename

## Request

### Body (application/json)

- `name` (string, required)

## Response

### 200

OK

- `data` (object, required)
  - `id` (integer, required)
  - `name` (string, required)
  - `user_id` (string, required)
  - `is_system` (boolean, required)
  - `parent_id` (integer, required)
  - `created_at` (datetime, required)
  - `file_count` (integer, required)
  - `updated_at` (datetime, required)
  - `deleted_at` (any, optional, nullable)
- `message` (string, required)
- `success` (boolean, required)

## Examples

**Request**

```json
{
  "name": "Campaign Gallery"
}
```

**Response**

```json
{
  "data": {
    "id": 11,
    "name": "Campaign Gallery",
    "user_id": "43028",
    "is_system": false,
    "parent_id": 10,
    "created_at": "2026-03-10T06:25:32Z",
    "file_count": 0,
    "updated_at": "2026-03-10T06:27:25Z"
  },
  "message": "Folder renamed successfully",
  "success": true
}
```

**SDK Code**

```python
import requests

url = "https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D"

payload = { "name": "Campaign Gallery" }
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"name":"Campaign Gallery"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D"

	payload := strings.NewReader("{\n  \"name\": \"Campaign Gallery\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Campaign Gallery\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Campaign Gallery\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D', [
  'body' => '{
  "name": "Campaign Gallery"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Campaign Gallery\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["name": "Campaign Gallery"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```