Vizit Public APIAPI
Spark Ideas

Request a Spark Idea

Ask Spark for written suggestions on a root image.

POST/v1/images/{image_id}/spark/ideas

Queues a Spark Idea 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 Idea. Use Retrieve a Spark Idea to poll for terminal states (COMPLETED / ERROR).

Idempotent on image_id: while an Idea is in flight for the image, subsequent calls return the existing Idea 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 Idea — 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 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.

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 to request a Spark Idea for. Must belong to the caller's organization and must not itself be Spark-generated.

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://ext.vizit.com/v1/images/497f6eca-6276-4993-bfeb-53cbbbba6f08/spark/ideas"
{  "idea_id": "513dcbd6-3206-4305-8a7e-8651161eebfb",  "image_id": "84c230fd-5520-4984-8119-37365b66fd80",  "status": "PROCESSING",  "result_url": "/v1/images/8f3e0d1a-1b2c-4f5e-9a3b-9c8d7e6f5a4b/spark/ideas/3e2a7c91-4b6d-4d8a-9c1e-7d5f0a1b2c3d",  "created_at": "2019-08-24T14:15:22Z"}
{  "idea_id": "513dcbd6-3206-4305-8a7e-8651161eebfb",  "image_id": "84c230fd-5520-4984-8119-37365b66fd80",  "status": "PROCESSING",  "result_url": "/v1/images/8f3e0d1a-1b2c-4f5e-9a3b-9c8d7e6f5a4b/spark/ideas/3e2a7c91-4b6d-4d8a-9c1e-7d5f0a1b2c3d",  "created_at": "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"}
{  "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"}

GETRetrieve an image score

Returns the current scoring state of an image previously sent to [Submit an image for scoring](/api/images/scoreImage). Poll until `status` leaves `PROCESSING`; `ERROR` responses carry `error_code` and `error_detail`. Hero images with GS1 hero analysis available additionally return `hero_gs1_components` alongside `vizit_score`. GS1 component scoring finishes shortly after the base score, so such a hero stays `PROCESSING` until both are available. A `COMPLETED` hero can still carry `hero_gs1_components: null` when GS1 analysis is not available for its organization or product category, or did not finish within the scoring window; treat `null` as "no breakdown", not as an error. Carousel images classified as an informational asset type (Alternate Product Views, Certification Mark, Included Items, Info Panel, Multi-Pack, Product Facts Panel, Size and Scale) are not scored and resolve to `error_code: IMAGE_OMITTED_FROM_SCORING`, with `classification` naming the type. Standalone product shots on a plain background may classify as Alternate Product Views; hero submissions are always scored. An image submitted with `benchmark_id` also carries `pair_score`, its score against that custom benchmark. `pair_score` can stay `PROCESSING` after `status` is `COMPLETED`, so poll until both settle when you need it.

GETRetrieve a Spark Idea

Returns the current state of a Spark Idea. Poll until `status` moves from `PROCESSING` to `COMPLETED` or `ERROR`. `data` carries the suggestion markdown only when `status` is `COMPLETED`. Ideas that have been non-terminal for longer than the 5-minute timeout are reported as `ERROR` here even when the database row still reads as in-flight.