Upload images to a collection
Download up to 50 images from URLs into a collection.
/v1/collections/{collection_id}/imagesDownloads up to 50 images and stores each in the collection, with the collection's image type and product category. Each image is a public HTTP or HTTPS URL to a JPEG, PNG or WebP image of up to 25 MB. New images are scored under the collection's existing scorings once their first scores land.
Each image succeeds or fails on its own, so one bad URL never
refuses the batch. The response is 202 with one result per
requested image, in request order: PROCESSING with an image_id
for a stored image, or ERROR with a reason for a failed one.
Downloads share a time budget, so an image not yet uploading when it
runs out fails with IMAGE_DOWNLOAD_TIMEOUT and is not stored.
There is no deduplication by URL: retrying a whole batch stores the accepted images again. Retry only the failed items.
Authorization
bearerAuth Short-lived access token issued by Create a token.
Send it on every request as Authorization: Bearer <token>.
In: header
Path Parameters
The id of a collection in your default workspace.
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Up to 50 images, uploaded in request order. More than 50 is rejected
with 413 TOO_MANY_IMAGES.
1 <= itemsResponse Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://ext.vizit.com/v1/collections/497f6eca-6276-4993-bfeb-53cbbbba6f08/images" \ -H "Content-Type: application/json" \ -d '{ "images": [ { "image_url": "https://cdn.example.com/products/abc/hero.jpg" } ] }'{ "results": [ { "image_id": "84c230fd-5520-4984-8119-37365b66fd80", "status": "PROCESSING", "reason": "IMAGE_TOO_LARGE" } ]}{ "detail": "string", "status_code": 0, "error_code": "IMAGE_DOWNLOAD_FAILED", "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", "extra": { "failed_urls": [ { "url": "https://cdn.example.com/broken.jpg", "reason": "IMAGE_DOWNLOAD_TIMEOUT" }, { "url": "https://cdn.example.com/icon.svg", "reason": "UNSUPPORTED_IMAGE_FORMAT" } ] }, "timestamp": "2019-08-24T14:15:22Z"}{ "detail": "string", "status_code": 0, "error_code": "IMAGE_DOWNLOAD_FAILED", "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", "extra": { "failed_urls": [ { "url": "https://cdn.example.com/broken.jpg", "reason": "IMAGE_DOWNLOAD_TIMEOUT" }, { "url": "https://cdn.example.com/icon.svg", "reason": "UNSUPPORTED_IMAGE_FORMAT" } ] }, "timestamp": "2019-08-24T14:15:22Z"}{ "detail": "string", "status_code": 0, "error_code": "IMAGE_DOWNLOAD_FAILED", "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", "extra": { "failed_urls": [ { "url": "https://cdn.example.com/broken.jpg", "reason": "IMAGE_DOWNLOAD_TIMEOUT" }, { "url": "https://cdn.example.com/icon.svg", "reason": "UNSUPPORTED_IMAGE_FORMAT" } ] }, "timestamp": "2019-08-24T14:15:22Z"}{ "detail": "string", "status_code": 0, "error_code": "IMAGE_DOWNLOAD_FAILED", "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", "extra": { "failed_urls": [ { "url": "https://cdn.example.com/broken.jpg", "reason": "IMAGE_DOWNLOAD_TIMEOUT" }, { "url": "https://cdn.example.com/icon.svg", "reason": "UNSUPPORTED_IMAGE_FORMAT" } ] }, "timestamp": "2019-08-24T14:15:22Z"}GETList a collection's images
Lists the images in a collection, sorted by `sort_by` and `sort_direction` with ties broken by image id. Page with `limit` and `offset`; the `Vizit-Total-Count` response header carries the number of images. Send `product_category_id` with exactly one of `benchmark_id` or `retailer` to have each row carry `pair_score`, from that pair's latest scoring of this collection ([Score a collection](/api/collections/requestCollectionScoring)). An incomplete pair answers `422 INVALID_SCORING_PAIR`. Without a pair `pair_score` is `null`, and `sort_by=pair_score` answers `422 SORT_REQUIRES_PAIR`. Unscored images sort last in both directions; informational images have `vizit_score: null` and `scored: false` and sort with them. `classification` is `null` for an Other asset.
POSTScore a collection
Scores the collection's visible images under `product_category_id` against exactly one of a custom benchmark (`benchmark_id`, of the same scope as the collection) or a retailer's Vizit benchmark (`retailer`). A custom benchmark needs `minimum_images` visible images. The response is `202` with a scoring `id`; poll it with [Retrieve a collection scoring](/api/collections/getCollectionScoring). Repeating the request for the same pair within 5 minutes returns the same scoring without queueing it again, so a retry is safe.