Skip to content

Delete API

The Delete API supports deleting files in CloudFlare ImgBed, including single file deletion and batch folder deletion functionality.

Basic Information

  • Endpoint: /api/manage/delete/{path}
  • Method: GET
  • Authentication: delete privileges required
  • Content Type: application/json

Request Parameters

Path Parameters

ParameterTypeRequiredDescription
pathstringYesFile path or folder path(e.g., file.png or your/folder)

Query Parameters

ParameterTypeRequiredDefaultDescription
folderbooleanNofalseWhether it's a folder deletion, true means delete entire folder and its contents

Functionality

Single File Deletion

When the folder parameter is false or not provided, deletes the specified single file.

Folder Deletion

When the folder parameter is true, recursively deletes the specified folder and all its subfolders and files.

Response Format

Single File Deletion Success Response

json
{
  "success": true,
  "fileId": "example/image.jpg"
}

Folder Deletion Success Response

json
{
  "success": true,
  "deleted": [
    "folder/image1.jpg",
    "folder/image2.png",
    "folder/subfolder/image3.gif"
  ],
  "failed": []
}

Error Response

json
{
  "success": false,
  "error": "Delete file failed"
}

Examples

Delete Single File

bash
curl --location --request DELETE 'https://your.domain/api/manage/delete/example,image.jpg' \
--header 'Authorization: Bearer your_token'

Delete Folder

bash
curl --location --request DELETE 'https://your.domain/api/manage/delete/example,folder?folder=true' \
--header 'Authorization: Bearer your_token'

Released under the MIT License