Vizit Public APIAPI
Collections

Create a collection

Start an empty collection in your default workspace.

POST/v1/collections

Creates an empty collection in your organization's default workspace. Add images with Upload images to a collection.

Names are unique within your default workspace: a name another collection there already holds answers 409 COLLECTION_NAME_EXISTS.

With a product_category_id, the collection is scored against the category's own Vizit benchmark and against default_benchmark when one is set. Those scorings are requested in the background and never fail the create.

Authorization

bearerAuth
Authorization<token>

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

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*string

Collection name, unique within your default workspace. Surrounding whitespace is trimmed and a blank name is rejected.

Lengthlength <= 200
image_type*string
Value in"hero" | "carousel"
product_category_id?|

Category the collection's images are scored under. Must be one returned by List product categories.

Formatuuid
product_title?|

Product title used when scoring the collection's hero images. Surrounding whitespace is trimmed and a blank title means none.

default_benchmark?|

Scored against as soon as the collection has a product category.

asset_type?|

Label for a collection of Other carousel assets. Surrounding whitespace is trimmed and a blank label means none. A hero collection cannot have one (422 HERO_ASSET_TYPE).

Lengthlength <= 50

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://ext.vizit.com/v1/collections" \  -H "Content-Type: application/json" \  -d '{    "name": "Spring refresh heroes",    "image_type": "hero"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "Spring refresh heroes",  "image_type": "hero",  "asset_type": "string",  "product_category_id": "8df7b127-d8ab-4b5d-a571-ee2b3ab38511",  "image_count": 0,  "last_scoring": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "benchmark_id": "f1254acf-0c77-40a6-91d2-a34bd4970fd9",    "retailer": "amazon",    "product_category_id": "8df7b127-d8ab-4b5d-a571-ee2b3ab38511",    "product_category_name": "Snack Bars",    "status": "PROCESSING",    "requested_at": "2019-08-24T14:15:22Z",    "ready_at": "2019-08-24T14:15:22Z",    "error_code": "ENQUEUE_FAILED"  }}
{  "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"}
{  "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