Delete folder

delete
Delete folder API

https://api.imagekit.io/v1/folder/
This will delete the specified folder and all nested files & folders. This action is cannot be undone.
Request
Response
Request
Headers
Authorization
required
string
base64 encoding of your_private_api_key: Note the colon in the end.
Query Parameters
folderPath
required
string
Full path to the folder you want to delete. For example folder/to/delete/
Response
204: No Content
Folder deleted successfully
404: Not Found
If no folder is found at the specified folderPath then a 404 response is returned.
{
"message" : "No folder found with folderPath folder/to/delete/",
"help" : "For support kindly contact us at support@imagekit.io .",
"reason" : "FOLDER_NOT_FOUND"
}

Response structure and status code

In case of an error, you will get an error code along with the error message. On success, you will receive a 204 status code with an empty body.

Examples

Here is the example request to understand the API usage.

cURL
cURL
curl -X DELETE "https://api.imagekit.io/v1/folder/" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
"folderPath" : "folder/to/delete/"
}
'