Create folder

Create folder API

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

This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created.

Headers

NameTypeDescription

Authorization

string

base64 encoding of your_private_api_key:

Note the colon in the end.

Request Body

NameTypeDescription

folderName

string

The folder will be created with this name. All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) will be replaced by an underscore i.e. _.

parentFolderPath

string

The folder where the new folder should be created, for root use / else the path e.g. containing/folder/.

Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass /product/images/summer, then product, images, and summer folders will be created if they don't already exist.

Response structure and status code

On success, you will receive a 201 status code with an empty body.

Examples

Here is the example request to understand the API usage.

curl -X POST "https://api.imagekit.io/v1/folder/" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
	"folderName" : "new_folder",
	"parentFolderPath" : "source/folder/path"
}
'

Last updated