Delete folder

Delete folder API

DELETE https://api.imagekit.io/v1/folder/

This will delete the specified folder and all nested files, their versions & folders. This action cannot be undone.

Headers

NameTypeDescription

Authorization

string

base64 encoding of your_private_api_key:

Note the colon in the end.

Request Body

NameTypeDescription

folderPath

string

Full path to the folder you want to delete. For example folder/to/delete/.

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 -X DELETE "https://api.imagekit.io/v1/folder/" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
	"folderPath" : "folder/to/delete/"
}
'
var imagekit = new ImageKit({
    publicKey : "your_public_api_key",
    privateKey : "your_private_api_key",
    urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
DeleteFolderRequest deleteFolderRequest = new DeleteFolderRequest
    {
        folderPath = "folder/to/delete/",
    };
ResultNoContent resultNoContent2 = imagekit.DeleteFolder(deleteFolderRequest);

Last updated