The unique fileId of the uploaded file. fileId is returned in list files API and upload API.
versionId*
string
The unique versionId of the uploaded file's version. This is returned in list files API and upload API as id within the versionInfo parameter.
Headers
Name
Type
Description
Authorization*
string
base64 encoding of your_private_api_key:
Note the colon in the end.
{"message" : "You cannot delete current version of a file.","help" : "For support kindly contact us at support@imagekit.io ."}
{"message" : "The requested asset 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 details 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-XDELETE"https://api.imagekit.io/v1/files/file_id/versions/version_id" \-u your_private_api_key: