> 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 File (Rename / Star)

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

## Update File (Rename / Star)

Updates file properties such as **renaming the file** or **marking it as starred**.

**Method:** `PUT`\
**URL:** `{{base_url}}/files/{{file_id}}`

***

## Authentication

This endpoint requires authentication.

* **Recommended:** Bearer token in the `Authorization` header:

```http
Authorization: Bearer {{access_token}}

```

Notes:

* If your collection/folder already sets auth, this request can **inherit auth**.

* Ensure `{{access_token}}` is a valid, non-expired token.

***

## Required variables

Set these variables at the **environment** or **collection** level:

| Variable       | Required | Description                                                              |
| -------------- | -------- | ------------------------------------------------------------------------ |
| `base_url`     | Yes      | Base API URL (e.g. `https://app.getgabs.com/partners/wp-gallery/manage`) |
| `access_token` | Yes      | Access token used to authorize the request                               |
| `file_id`      | Yes      | ID of the file to update                                                 |

***

## Path Parameters

| Parameter | Type    | Required | Description                             |
| --------- | ------- | -------- | --------------------------------------- |
| `file_id` | integer | Yes      | Unique identifier of the file to update |

Example request URL:

```
{{base_url}}/files/34

```

***

## Body (raw JSON)

Send the request body as **raw JSON**.

| Field     | Type    | Required | Description                        |
| --------- | ------- | -------- | ---------------------------------- |
| `name`    | string  | No       | New name for the file              |
| `starred` | boolean | No       | Mark or unmark the file as starred |

Example body:

```json
{
  "name": "renamed-photo.png",
  "starred": true
}

```

Notes:

* You can update **either field independently**.

* If `name` is provided, the file will be **renamed**.

* If `starred` is provided, the file will be **starred or unstarred**.

***

## Sample request

```bash
curl --request PUT "{{base_url}}/files/{{file_id}}" \
  --header "Authorization: Bearer {{access_token}}" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "renamed-photo.png",
    "starred": true
  }'

```

***

## Sample success response

A successful update typically returns **HTTP 200 OK**.

```json
{
  "success": true,
  "message": "File updated successfully",
  "data": {
    "id": 34,
    "user_id": "43028",
    "folder_id": 10,
    "name": "renamed-photo.png",
    "original_name": "Frame 1000003420.png",
    "path": "cdngallery/9f86443bd9f2ad28d1be4b62e8783e96720ec87a2ba86fcbeb5fc537483bf05b/files/5/MEL37P9ilmLodrQg.png",
    "hash": "b302a431204139c0572ab43b0d2bbc71297e8e1c21445d8daa786126de2d1cb1",
    "path_hash": null,
    "mime_type": "image/png",
    "type": "image",
    "extension": "png",
    "size": 87963,
    "url": "https://business.me-mate.net/getgabs-uploads/cdngallery/9f86443bd9f2ad28d1be4b62e8783e96720ec87a2ba86fcbeb5fc537483bf05b/files/5/MEL37P9ilmLodrQg.png",
    "is_starred": false,
    "is_whatsapp_compatible": true,
    "whatsapp_compatibility_reason": "Ready for WhatsApp",
    "uploaded_at": "2026-03-10T04:37:27.000000Z",
    "created_at": "2026-03-10T04:37:27.000000Z",
    "updated_at": "2026-03-10T06:15:07.000000Z",
    "deleted_at": null,
    "tags": [],
    "folder": {
      "id": 10,
      "user_id": "43028",
      "name": "test2",
      "parent_id": 9,
      "is_system": false,
      "file_count": 14,
      "created_at": "2026-03-09T13:10:07.000000Z",
      "updated_at": "2026-03-10T05:34:50.000000Z",
      "deleted_at": null
    }
  }
}

```

***

## Common errors

* **400 Bad Request**

  * Invalid request body

  * Invalid file name format
* **401 Unauthorized / 403 Forbidden**

  * Missing/invalid `Authorization` header

  * Expired `{{access_token}}`
* **404 Not Found**

  * File with the given `file_id` does not exist

***

## Notes

* This endpoint allows updating **file metadata only**.

* It does **not replace or re-upload the file content**.

* The `name` field only changes the **display name** of the file in the system.

* The `starred` flag can be used to **highlight important files** for easier access.

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/file-upload-ap-is/update-file-rename-star

## Request

### Body (application/json)

- `name` (string, required)
- `starred` (boolean, required)

## Response

### 200

OK

- `data` (object, required)
  - `id` (integer, required)
  - `url` (string, required)
  - `hash` (string, required)
  - `name` (string, required)
  - `path` (string, required)
  - `size` (integer, required)
  - `tags` (list of any, required)
  - `type` (string, required)
  - `folder` (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)
  - `user_id` (string, required)
  - `extension` (string, required)
  - `folder_id` (integer, required)
  - `mime_type` (string, required)
  - `created_at` (datetime, required)
  - `is_starred` (boolean, required)
  - `updated_at` (datetime, required)
  - `uploaded_at` (datetime, required)
  - `original_name` (string, required)
  - `is_whatsapp_compatible` (boolean, required)
  - `whatsapp_compatibility_reason` (string, required)
  - `path_hash` (any, optional, nullable)
  - `deleted_at` (any, optional, nullable)
- `message` (string, required)
- `success` (boolean, required)

## Examples

**Request**

```json
{
  "name": "renamed-photo.png",
  "starred": true
}
```

**Response**

```json
{
  "data": {
    "id": 34,
    "url": "https://business.me-mate.net/getgabs-uploads/cdngallery/9f86443bd9f2ad28d1be4b62e8783e96720ec87a2ba86fcbeb5fc537483bf05b/files/5/MEL37P9ilmLodrQg.png",
    "hash": "b302a431204139c0572ab43b0d2bbc71297e8e1c21445d8daa786126de2d1cb1",
    "name": "renamed-photo.png",
    "path": "cdngallery/9f86443bd9f2ad28d1be4b62e8783e96720ec87a2ba86fcbeb5fc537483bf05b/files/5/MEL37P9ilmLodrQg.png",
    "size": 87963,
    "tags": [
      {
        "key": "value"
      }
    ],
    "type": "image",
    "folder": {
      "id": 10,
      "name": "test2",
      "user_id": "43028",
      "is_system": false,
      "parent_id": 9,
      "created_at": "2026-03-09T13:10:07Z",
      "file_count": 14,
      "updated_at": "2026-03-10T05:34:50Z"
    },
    "user_id": "43028",
    "extension": "png",
    "folder_id": 10,
    "mime_type": "image/png",
    "created_at": "2026-03-10T04:37:27Z",
    "is_starred": false,
    "updated_at": "2026-03-10T06:15:07Z",
    "uploaded_at": "2026-03-10T04:37:27Z",
    "original_name": "Frame 1000003420.png",
    "is_whatsapp_compatible": true,
    "whatsapp_compatibility_reason": "Ready for WhatsApp"
  },
  "message": "File updated successfully",
  "success": true
}
```

**SDK Code**

```python
import requests

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

payload = {
    "name": "renamed-photo.png",
    "starred": True
}
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/files/%7Bfile_id%7D';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"name":"renamed-photo.png","starred":true}'
};

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/files/%7Bfile_id%7D"

	payload := strings.NewReader("{\n  \"name\": \"renamed-photo.png\",\n  \"starred\": true\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/files/%7Bfile_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\": \"renamed-photo.png\",\n  \"starred\": true\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/files/%7Bfile_id%7D")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"renamed-photo.png\",\n  \"starred\": true\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/files/%7Bfile_id%7D', [
  'body' => '{
  "name": "renamed-photo.png",
  "starred": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "name": "renamed-photo.png",
  "starred": true
] 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/files/%7Bfile_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()
```