Copy folder

Copy folder API

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

This will copy one folder into another.

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 copy. For example - /path/of/source/folder.

destinationPath

string

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

includeFileVersions

boolean

Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied.

Default value - false

{
    "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/copyFolder" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
	"sourceFolderPath" : "/folder/to/copy",
	"destinationPath" : "/folder/to/copy/into/",
        "includeFileVersions": true
}
'

Last updated