Cloudimage - Documentation

Invalidation API

The Invalidation API is a REST API to invalidate 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:

Photo alt \#responsive

Step 2 - call the Invalidation REST API

POST https://api.cloudimage.com/invalidate

Headers:

X-Client-Key: your_API_KEY
Content-Type: application/json

Body:

The body of the request must contain the invalidation url in the form /v7/original_image_url?operation&filter.

To invalidate: https://doc.cloudimg.io/v7/sample.li/boat.jpg?width=300

Use: /v7/sample.li/boat.jpg?width=300 or v7/sample.li/boat.jpg?width=300

Invalidate multiple images
{
  "scope": "urls",
  "urls": ["/v7/sample.li/paris.jpg?width=400",
           "/v7/sample.li/flat.jpg?width=400", ...
          ]
}
Invalidate multiple images with all their resizes
{
  "scope": "original",
  "urls": ["sample.li/birds.jpg",
            "sample.li/boat.jpg", ...
  ]
}

Original flushes require the entire log database to be searched, hence can take longer (up to 60 seconds)

Invalidate all your images (this will trigger a re-download of all images from your origin)
{
  "scope": "all"
}

Flushing all images will result in Cloudimage downloading all your images from your origin image storage again. This will result in slower image loading times for the first times the images are downloaded. Contact us if you have more than 1 TB of monthly CDN traffic or 1 TB of storage.

Try it out with the doc token doc

You can use our sample image showing the time it is resized the first time:

https://doc.cloudimg.io/v7/sample.li/now.php?width=500

Click on 'Send' to call the Invalidation API and reload the image above (invalidation takes about 30 seconds to complete). You should see the new time. You might need to disable your browser's local cache to see the new image immediately.

host: "https://api.cloudimage.com" path: "/invalidate" theme: light headers: X-Client-key: client_6920ed1c0250489b8d52b53 editor_theme: light method: POST body: | { "scope" : "url", "url": "/v7/sample.li/now.php?width=500" }