get
https://api.imagekit.io
/v1/files/{fileId}/versions/{versionId}

This API returns an object with details or attributes of a file version.

fileId
string
required

The unique fileId of the uploaded file. fileId is returned in list and search assets API and upload API.

versionId
string
required

The unique versionId of the uploaded file. versionId is returned in list and search assets API and upload API.

Auth
API key
:
Parameters
:
:
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 GET \
--url https://api.imagekit.io/v1/files/fileId/versions/versionId \
--header 'Accept: application/json' \
--header 'Authorization: Basic 123'

File version details object.

fileId
string

Unique identifier of the asset.

type
string

Type of the asset.

Allowed values:
filefile-version
name
string

Name of the asset.

filePath
string

Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be /file.jpg. If the file is inside a folder named images, the path will be /images/file.jpg.

tags

An array of tags assigned to the file. Tags are used to search files in the media library.

AITags

An array of tags assigned to the file by auto tagging.

name
string

Name of the tag.

confidence
number

Confidence score of the tag.

source
string

Source of the tag. Possible values are google-auto-tagging and aws-auto-tagging.

versionInfo
object

An object with details of the file version.

id
string

Unique identifier of the file version.

name
string

Name of the file version.

isPrivateFile
boolean

Specifies if the file is private or not.

isPublished
boolean

Specifies if the file is published or not.

customCoordinates

An string with custom coordinates of the file.

url
string

URL of the file.

thumbnail
string

URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library.

fileType
string

Type of the file. Possible values are image, non-image.

mime
string

MIME type of the file.

width
number

Width of the file.

height
number

Height of the file.

size
number

Size of the file in bytes.

hasAlpha
boolean

Specifies if the image has an alpha channel.

customMetadata
object

An object with custom metadata for the file.

createdAt
string

Date and time when the file was uploaded. The date and time is in ISO8601 format.

updatedAt
string

Date and time when the file was last updated. The date and time is in ISO8601 format.

1
{
2
"fileId": "598821f949c0a938d81963bd",
3
"type": "file-version",
4
"name": "file.jpg",
5
"filePath": "/images/products/file.jpg",
6
"tags": [
7
"t-shirt",
8
"sale2019"
9
],
10
"AITags": [
11
{
12
"name": "Shirt",
13
"confidence": 90.12,
14
"source": "google-auto-tagging"
15
},
16
{
17
"name": "T-shirt",
18
"confidence": 80.12,
19
"source": "aws-auto-tagging"
20
}
21
],
22
"versionInfo": {
23
"id": "598821f949c0a938d57563bd",
24
"name": "Version 1"
25
},
26
"isPrivateFile": false,
27
"customCoordinates": null,
28
"url": "https://ik.imagekit.io/your_imagekit_id/images/products/file.jpg?ik-obj-version=iAg8gxkqo_QUBwqNeQrJzuyce2XB7Gc4&updatedAt=1566630881313",
29
"thumbnail": "https://ik.imagekit.io/your_imagekit_id/images/products/file.jpg?ik-obj-version=iAg8gxkqo_QUBwqNeQrJzuyce2XB7Gc4&updatedAt=1566630881313&tr=n-ik_ml_thumbnail",
30
"fileType": "image",
31
"mime": "image/jpeg",
32
"width": 100,
33
"height": 100,
34
"size": 100,
35
"hasAlpha": false,
36
"customMetadata": {
37
"brand": "Nike",
38
"color": "red"
39
},
40
"createdAt": "2019-08-24T06:15:41.313Z",
41
"updatedAt": "2019-08-24T06:15:41.313Z"
42
}

Examples

Here is the example request to understand the API usage.

Copy
# 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",
})
var imagekit = new ImageKit({
    publicKey : "your_public_api_key",
    privateKey : "your_private_api_key",
    urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
ResultFileVersionDetails resultFileVersionDetails = imagekit.GetFileVersionDetails("file_Id", "version_Id");