Copy folder
post
https://api.imagekit.io
/v1/bulkJobs/copyFolder
Copy folder API

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.

Examples

Here is the example request to understand the API usage.
cURL
Node.js
Ruby
1
curl -X POST "https://api.imagekit.io/v1/bulkJobs/copyFolder" \
2
-H 'Content-Type: application/json' \
3
-u your_private_key: -d '
4
{
5
"sourceFolderPath" : "/folder/to/copy",
6
"destinationPath" : "/folder/to/copy/into/",
7
"includeFileVersions": true
8
}
9
'
Copied!
1
var ImageKit = require("imagekit");
2
3
var imagekit = new ImageKit({
4
publicKey : "your_public_api_key",
5
privateKey : "your_private_api_key",
6
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
7
});
8
9
imagekit.copyFolder({
10
sourceFolderPath: "/folder/to/copy",
11
destinationPath: "/folder/to/copy/into/",
12
includeFileVersions: false // optional
13
}, function(error, result) {
14
if(error) console.log(error);
15
else console.log(result);
16
});
Copied!
1
imagekitio = ImageKitIo::Client.new("your_private_key", "your_public_key", "your_url_endpoint")
2
imagekitio.copy_folder(
3
source_folder_path: '/folder/to/copy',
4
destination_path: '/folder/to/copy/into/',
5
include_file_versions: false # optional
6
)
Copied!