{"message": "The requested file does not exist.","help": "For support kindly contact us at support@imagekit.io ."}
{"message": "The requested file version does not exist.","help": "For support kindly contact us at support@imagekit.io ."}
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.
# 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-XPUT"https://api.imagekit.io/v1/files/file_id/versions/version_id/restore" \-u your_private_api_key:
var imagekit = new ImageKit({
publicKey : "your_public_api_key",
privateKey : "your_private_api_key",
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
Result result = imagekit.RestoreFileVersion("file_Id", "version_Id");