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 JSON-encoded response body.
The response depends upon the value of purgeCache in the request. If purgeCache is set to true, the response contains purgeRequestId, which can be used to get the purge cache status.
purgeCache=true
purgeCache=false or unset
1
// When purgeCache is set to true, we send the purge request ID.
2
// You can use this to get purge status
3
{
4
purgeRequestId:"598821f949c0a938d57563bd"
5
}
Copied!
1
// When purgeCache is set to false or not set
2
{}
Copied!
Example
Here is an example request to understand API usage.
cURL
Ruby
1
curl -X PUT "https://api.imagekit.io/v1/files/rename"\