Vizit Public APIAPI
Benchmarks

Upload an image to a benchmark

Download an image from a URL and add it to a custom benchmark.

POST/v1/benchmarks/{benchmark_id}/images/upload

Downloads one image from image_url, stores it in your default workspace with the benchmark's scope as its image type, and adds it to the benchmark. The image is downloaded with the same checks as Submit an image for scoring: a public HTTP or HTTPS URL to a JPEG, PNG or WebP image of up to 25 MB.

Send product_category_id to score the image under that category as it lands. The response is 202 with status: PROCESSING, since scoring runs after the upload.

Authorization

bearerAuth
Authorization<token>

Short-lived access token issued by Create a token. Send it on every request as Authorization: Bearer <token>.

In: header

Path Parameters

benchmark_id*string

The id of a custom benchmark in your default workspace.

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

image_url*string

Public HTTP or HTTPS image URL (JPEG, PNG or WebP, up to 25 MB).

Length1 <= length
name?|

Image name; defaults to the file name in the URL. A scorable file extension is added when the name has none.

Length1 <= length <= 255
product_category_id?|

Scores the image under this category as it uploads. Must be one returned by List product categories.

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://ext.vizit.com/v1/benchmarks/497f6eca-6276-4993-bfeb-53cbbbba6f08/images/upload" \  -H "Content-Type: application/json" \  -d '{    "image_url": "https://cdn.example.com/products/abc/hero.jpg"  }'
{  "image_id": "84c230fd-5520-4984-8119-37365b66fd80",  "status": "PROCESSING"}
{  "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"}
Empty
{  "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"}
Empty
{  "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"}