Invalidation API
Create invalidation requests via API
The Invalidation API is a REST API that lets you remove cached images from the CDN and Cloudimage resizing servers.
Step 1. Get your API key
Your API key is available in the Cloudimage admin console, under Invalidation:

Step 2. Call the Invalidation REST API
POST https://api.cloudimage.com/invalidate
X-Client-Key: your_API_KEY
Content-Type: application/json
Body:
For Cloudimage tokens created before November 2021, the invalidated URL should include "/v7/". Example: /v7/https://img.domain.com/image2.jpg
For Cloudimage tokens created after November 2021, the invalidated URL should not include "/v7/". Example: https://img.domain.com/image2.jpg
If you are using the Origin prefix, its value should not be included. Example: images/image1.jpg
If you are using an alias, the alias should be invalidated (not the original value behind it). Example: _alias_/images/image1.jpg
If you are using Invalidation with scope 'original', please do not append any Cloudimage query string parameters at the end of the invalidated URL. Example:
correct URL format: https://img.domain.com/image2.jpg
incorrect URL format: https://img.domain.com/image2.jpg?w=600
Invalidate multiple images with all their resizes
{
"scope": "original",
"urls": ["/sample.li/birds.jpg",
"/sample.li/boat.jpg", ...
]
}
Invalidate all your images
{
"scope": "all"
}
Try it out with the doc token
You can use our sample image showing the time it is resized the first time:
Last updated
Was this helpful?