Move file

post
Move file API

https://api.imagekit.io/v1/files/move
This will move a file from one folder to another.
Request
Response
Request
Headers
Authorization
required
string
base64 encoding of your_private_api_key: Note the colon in the end.
Body Parameters
sourceFilePath
required
string
The full path of the file you want to move. For example - /path/to/file.jpg
destinationPath
required
string
Full path to the folder you want to move above file into. For example - /folder/to/move/into/
Response
204: No Content
404: Not Found
If no file is found at the specified sourceFilePath then a 404 response is returned.
{
"message" : "No file found with filePath /path/to/file.jpg",
"help" : "For support kindly contact us at support@imagekit.io .",
"reason" : "SOURCE_FILE_MISSING"
}

Response structure and status code

In case of error, you will get an error code along with the error message. On success, you will receive a 204 status code with an empty body.

Examples

Here is the example request to understand the API usage.

cURL
cURL
curl -X POST "https://api.imagekit.io/v1/files/move" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
"sourceFilePath" : "/path/to/file.jpg",
"destinationPath" : "/folder/to/move/into/"
}
'