Get file version details
get
https://api.imagekit.io
/v1/files/:fileId/versions/:versionId
Get file version details API

Response structure and status code (application/JSON)

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 the file object in JSON-encoded response body.

Examples

Here is the example request to understand the API usage.
cURL
Node.js
Python
PHP
Java
Ruby
Go
# The unique fileId and versionId of the uploaded file. fileId and versionId (versionInfo.id) is returned in response of list files API and upload API.
curl -X GET "https://api.imagekit.io/v1/files/file_id/versions/version_id" \
-u your_private_api_key:
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.getFileVersionDetails({
fileId: "file_id",
versionId: "version_id"
}, 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/'
)
file_versions_details = imagekit.get_file_version_details(file_id='file_id', version_id='version_id')
print("Get File version details-", "\n", file_versions_details)
# Raw Response
print(file_versions_details.response_metadata.raw)
# print that file's id
print(file_versions_details.file_id)
# print that file's version id
print(file_versions_details.version_info.id)
$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
);
$fileId = 'file_id';
$versionId = 'version_id';
$getFileVersionDetails = $imageKit->getFileVersionDetails($fileId, $versionId);
echo("File Version details : " . json_encode($getFileVersionDetails));
String fileId = "file_id";
String versionId = "version_id";
ResultFileVersionDetails resultFileVersionDetails = ImageKit.getInstance().getFileVersionDetails(fileId, versionId);
imagekitio = ImageKitIo::Client.new("your_private_key", "your_public_key", "your_url_endpoint")
imagekitio.file_version_detail(
file_id: 'file_id',
version_id: 'version_id'
)
versionsResp, err = ik.Media.FileVersions(ctx, media.FileVersionsParam{
FileId: "file_id",
VersionId: "version_id",
})
Copy link
On this page
get
Get file version details API
Response structure and status code (application/JSON)
Examples