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

# Bulk Delete Files

POST https://business.me-mate.net/partners/wp-gallery/manage/files/bulk-delete
Content-Type: application/json

## Bulk Delete Files

Moves multiple files to **trash** in a single request. This performs a **soft delete**, allowing the files to be restored later if needed.

**Method:** `POST`\
**URL:** `{{base_url}}/files/bulk-delete`

***

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

***

## Headers

| Header          | Value                     |
| --------------- | ------------------------- |
| `Content-Type`  | `application/json`        |
| `Authorization` | `Bearer {{access_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                               |

***

## Body (raw JSON)

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

| Field      | Type  | Required | Description                        |
| ---------- | ----- | -------- | ---------------------------------- |
| `file_ids` | array | Yes      | Array of file IDs to move to trash |

Example body:

```json
{
  "file_ids": [
    37
  ]
}

```

Notes:

* You can include **one or multiple file IDs** in the array.

* All specified files will be **moved to trash**.

***

## Sample request

```bash
curl --request POST "{{base_url}}/files/bulk-delete" \
  --header "Authorization: Bearer {{access_token}}" \
  --header "Content-Type: application/json" \
  --data '{
    "file_ids": [37]
  }'

```

***

## Sample success response

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

```json
{
  "success": true,
  "message": "1 file(s) moved to trash"
}

```

***

## Common errors

* **400 Bad Request**

  * Missing `file_ids`

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

  * Missing/invalid `Authorization` header

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

  * One or more files do not exist

***

## Notes

* This endpoint performs a **soft delete** on multiple files.

* The files are **not permanently deleted** and can be restored using the **Restore File from Trash** endpoint.

* To **permanently remove files**, use the **Permanently Delete File** endpoint.

* This endpoint is useful for **bulk operations in file managers or gallery interfaces**.

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/bulk-delete-files

## Request

### Body (application/json)

- `file_ids` (list of integer, required)

## Response

### 200

OK

- `message` (string, required)
- `success` (boolean, required)

## Examples

**Request**

```json
{
  "file_ids": [
    1024,
    2048,
    4096
  ]
}
```

**Response**

```json
{
  "message": "3 file(s) moved to trash",
  "success": true
}
```

**SDK Code**

```python
import requests

url = "https://business.me-mate.net/partners/wp-gallery/manage/files/bulk-delete"

payload = { "file_ids": [1024, 2048, 4096] }
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://business.me-mate.net/partners/wp-gallery/manage/files/bulk-delete';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"file_ids":[1024,2048,4096]}'
};

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/bulk-delete"

	payload := strings.NewReader("{\n  \"file_ids\": [\n    1024,\n    2048,\n    4096\n  ]\n}")

	req, _ := http.NewRequest("POST", 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/bulk-delete")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"file_ids\": [\n    1024,\n    2048,\n    4096\n  ]\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.post("https://business.me-mate.net/partners/wp-gallery/manage/files/bulk-delete")
  .header("Content-Type", "application/json")
  .body("{\n  \"file_ids\": [\n    1024,\n    2048,\n    4096\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://business.me-mate.net/partners/wp-gallery/manage/files/bulk-delete', [
  'body' => '{
  "file_ids": [
    1024,
    2048,
    4096
  ]
}',
  '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/bulk-delete");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"file_ids\": [\n    1024,\n    2048,\n    4096\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["file_ids": [1024, 2048, 4096]] 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/bulk-delete")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```