Move folder

Move folder API

POST https://api.imagekit.io/v1/bulkJobs/moveFolder

This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history.

Headers

NameTypeDescription

Authorization

string

base64 encoding of your_private_api_key:

Note the colon in the end.

Request Body

NameTypeDescription

sourceFolderPath

string

The full path to the source folder you want to move. For example - /path/of/source/folder.

destinationPath

string

Full path to the destination folder where you want to move the source folder into. For example - /path/of/destination/folder.

{
    "jobId" : "598821f949c0a938d57563bd"
}

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 200 status code with JSON encoded response containing information about jobId. You can use jobId to get the status of this job using bulk job status API.

Access control and permissions

Read how access and permissions are affected by this operation here.

Examples

Here is the example request to understand the API usage.

curl -X POST "https://api.imagekit.io/v1/bulkJobs/moveFolder" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
	"sourceFolderPath" : "/folder/to/move",
	"destinationPath" : "/folder/to/move/into/"
}
'

Last updated