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.

sourceFolderPath
string
required

The full path to the source folder you want to move.

Example:
/path/of/source/folder
destinationPath
string
required

Full path to the destination folder where you want to move the source folder into.

Example:
/path/of/destination/folder
Auth
API key
:
Body
Note

Here, you can explore machine-generated code examples. For practical applications, refer to the examples section below, which includes detailed code snippets from the ImageKit SDKs.

curl --request POST \
--url https://api.imagekit.io/v1/bulkJobs/moveFolder \
--header 'Accept: application/json' \
--header 'Authorization: Basic 123' \
--header 'Content-Type: application/json' \
--data '{
"sourceFolderPath": "/path/of/source/folder",
"destinationPath": "/path/of/destination/folder"
}'

Job submitted successfully. A jobId will be returned.

responses
/
200
jobId
string

Unique identifier of the bulk job. This can be used to check the status of the bulk job.

1
{
2
"jobId": "string"
3
}

Examples

Here is the example request to understand the API usage.

Copy
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/"
}
'
var ImageKit = require("imagekit");

var imagekit = new ImageKit({
    publicKey : "your_public_api_key",
    privateKey : "your_private_api_key",
    urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});

imagekit.moveFolder({
     sourceFolderPath: "/folder/to/move",
     destinationPath: "/folder/to/move/into/"
}, function(error, result) {
    if(error) console.log(error);
    else console.log(result);
});
from imagekitio import ImageKit

imagekit = ImageKit(
    public_key='your_public_api_key',
    private_key='your_private_api_key',
    url_endpoint = 'https://ik.imagekit.io/your_imagekit_id/'
)

move_folder = imagekit.move_folder(options=MoveFolderRequestOptions(source_folder_path="/demo1/testing",
                                                                    destination_path="/"))

print("Move folder-", move_folder, end="\n\n")

# Raw Response
print(move_folder.response_metadata.raw)

# print the job's id
print(move_folder.job_id)
use ImageKit\ImageKit;

$public_key = "your_public_api_key";
$your_private_key = "your_private_api_key";
$url_end_point = "https://ik.imagekit.io/your_imagekit_id";

$imageKit = new ImageKit(
    $public_key,
    $your_private_key,
    $url_end_point
);

$sourceFolderPath = '/folder/to/move';
$destinationPath = '/folder/to/move/into/';
$moveFolder = $imageKit->moveFolder([
    'sourceFolderPath' => $sourceFolderPath,
    'destinationPath' => $destinationPath
]);

echo("Move Folder : " . json_encode($moveFolder));
MoveFolderRequest moveFolderRequest = new MoveFolderRequest();
moveFolderRequest.setSourceFolderPath("/folder/to/move");
moveFolderRequest.setDestinationPath("/folder/to/move/into/");
ResultOfFolderActions resultOfFolderActions = ImageKit.getInstance().moveFolder(moveFolderRequest);
imagekitio = ImageKitIo::Client.new("your_private_key", "your_public_key", "your_url_endpoint")
imagekitio.move_folder(source_folder_path: '/folder/to/move', destination_path: '/folder/to/move/into/')
resp, err := ik.Media.MoveFolder(ctx, media.MoveFolderParam{
    SourceFolderPath: "/folder/to/move",
    DestinationPath: "/folder/to/move/into/",
})

var imagekit = new ImageKit({
    publicKey : "your_public_api_key",
    privateKey : "your_private_api_key",
    urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
MoveFolderRequest moveFolderRequest = new MoveFolderRequest
    {
        sourceFolderPath = "/folder/to/move",
        destinationPath = "/folder/to/move/into/"
    };
ResultOfFolderActions resultOfFolderActions1 = imagekit.MoveFolder(moveFolderRequest);