Vizit Public APIAPI
Spark Images

Retrieve a Spark Images batch

Poll for the result of a previously requested Spark Images batch.

GET/v1/images/{image_id}/spark/images/{batch_id}

Returns the current state of a Spark Images batch. Poll until status moves from PROCESSING to COMPLETED or ERROR.

data is empty until status is COMPLETED. The batch only completes once every prompt is terminal and Spark Cull has resolved every child image; while cull is settling it stays PROCESSING with empty data. Once COMPLETED, data holds the visible children only — each with a short-lived pre-signed download URL that a fresh request refreshes, plus that child's score (score_status, vizit_score, vizit_certified, and score_error_code when Vizit does not score the image). One call is therefore enough to get the images and their scores; Retrieve an image score remains available for a single child and adds the hero GS1 component detail. A batch that has been non-terminal for longer than the 5-minute timeout is reported as ERROR here even when the database rows still read as in-flight.

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

image_id*string

Root image the batch was requested for.

Formatuuid
batch_id*string

The batch_id returned by Request a Spark Images batch.

Formatuuid

Response Body

application/json

application/json

application/json

curl -X GET "https://ext.vizit.com/v1/images/497f6eca-6276-4993-bfeb-53cbbbba6f08/spark/images/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "batch_id": "4da22c97-b7d5-4e31-8c3a-03870ebc7b20",  "image_id": "84c230fd-5520-4984-8119-37365b66fd80",  "status": "PROCESSING",  "error_code": "SPARK_GENERATION_FAILED",  "data": [    {      "image_id": "84c230fd-5520-4984-8119-37365b66fd80",      "url": "http://example.com",      "url_expires_at": "2019-08-24T14:15:22Z",      "score_status": "COMPLETED",      "score_error_code": "IMAGE_OMITTED_FROM_SCORING",      "vizit_score": 84.2,      "vizit_certified": true    }  ],  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "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"}

POSTRequest a Spark Images batch

Queues a Spark Images batch for the image and returns immediately with `status: PROCESSING` — a fresh request starts in flight, and an idempotent reuse only ever matches an in-flight batch. Use [Retrieve a Spark Images batch](/api/spark-images/getSparkImagesBatch) to poll for terminal states (`COMPLETED` / `ERROR`). Idempotent on `image_id`: while a batch is in flight for the image, subsequent calls return the existing batch with `200 OK` instead of creating a new one. A fresh create returns `202 Accepted`. The organization check runs before the idempotent lookup, so callers from a different organization cannot reuse another org's in-flight batch — they get `404 IMAGE_NOT_FOUND` instead. Hero images with GS1 hero analysis available are only accepted once their GS1 component scores are stored; until then the request returns `409 HERO_GS1_SCORES_MISSING`. Wait for [Retrieve an image score](/api/images/getImageScore) to report `COMPLETED` with `hero_gs1_components` populated before requesting Spark work. The 409 `detail` says whether the scores are still being computed or will never be available for the image.

GETList custom benchmarks

Lists the custom benchmarks in your organization's default workspace, sorted by `sort_by` and `sort_direction`. Deleted benchmarks and Vizit benchmarks are never listed. Page with `limit` and `offset`; the `Vizit-Total-Count` response header carries the number of benchmarks that match the filters. Custom benchmarks must be enabled for your organization. Until they are, every benchmark and collection route answers `404 NOT_FOUND`.