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

# Delete Folder

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

## Delete Folder

Deletes a folder for the authenticated user.

> ⚠️ Deleting a folder may also affect its **files and subfolders** depending on the system implementation.

**Method:** `DELETE`\
**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                      |
| ------------- | -------------------------- |
| Authorization | Bearer \{\{access\_token}} |

***

## Path Parameters

| Parameter   | Type    | Required | Description                |
| ----------- | ------- | -------- | -------------------------- |
| `folder_id` | integer | Yes      | ID of the folder to delete |

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

***

## Sample Request

```bash
curl --request DELETE "{{base_url}}/folders/{{folder_id}}" \
  --header "Authorization: Bearer {{access_token}}"

```

***

## Sample Success Response

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

```json
{
  "success": true,
  "message": "Folder deleted successfully"
}

```

***

## Common Errors

* **400 Bad Request**

  * Invalid `folder_id`
* **401 Unauthorized / 403 Forbidden**

  * Missing or invalid `Authorization` header

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

  * Folder does not exist

***

## Notes

* Deleting a folder may **also remove or relocate files and subfolders** depending on the system rules.

* System folders like trash, recent etc may not be deletable.

* Ensure the folder is not required by other operations before deleting.

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/delete-folder

## Response

### 200

OK

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

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "message": "Folder deleted successfully",
  "success": true
}
```

**SDK Code**

```python
import requests

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

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

response = requests.delete(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: 'DELETE', headers: {'Content-Type': 'application/json'}, body: '{}'};

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("{}")

	req, _ := http.NewRequest("DELETE", 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::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

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.delete("https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://business.me-mate.net/partners/wp-gallery/manage/folders/%7Bfolder_id%7D', [
  'body' => '{}',
  '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.DELETE);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] 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 = "DELETE"
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()
```