Generating Image Variants - Incorrect Docs?

This doc describes how to do it: https://developers.cloudflare.com/images/cloudflare-images/transform/resize-images/
curl -X POST "https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/images/v1/variants" \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: application/json" \
--data '{"id":"<NAME_OF_THE_VARIANT>","options":{"fit":"scale-down","metadata":"none","width":1366,"height":768},"neverRequireSignedURLs":true}
curl -X POST "https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/images/v1/variants" \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: application/json" \
--data '{"id":"<NAME_OF_THE_VARIANT>","options":{"fit":"scale-down","metadata":"none","width":1366,"height":768},"neverRequireSignedURLs":true}
However nowhere in that request is there the image ID that the variant is supposed to be based on. The same issue is in https://developers.cloudflare.com/api/operations/cloudflare-images-variants-create-a-variant. There's no image ID passed to the API. Cloudflare would need this to create a variant. How should I send the image ID?
Resize images · Cloudflare Image Optimization docs
Resizing images in Cloudflare Images works by creating variants of your image. Variants let you specify how images should be resized for different use …
Cloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
2 Replies
Chaika
Chaika13mo ago
No, Variants are just account based. You create a variant, and all of your images can now use that variant. It's like a preset, instead of using Flexible Variants which can be any of those settings
hellcow
hellcowOP13mo ago
Ah, I see! Thank you!
Want results from more Discord servers?
Add your server