Poll a generation
GET /generations/{jobId}
Read a generation job belonging to the SDK key’s store. Poll about every two seconds until a final result or failure, with a deadline and cancellation in your UI.
Request
Section titled “Request”Authentication: X-Antla-SDK-Key: YOUR_ANTLA_SDK_KEY.
Uses the shared IP rate limit. Polling is included in that same counter. See Errors and rate limits.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
jobId | path | string, UUID | Yes | Job ID returned by generation submission. |
uniqueUserId | query | string | No | Saved visitor ID for customer-limit accounting; not job authorization. |
Example request
Section titled “Example request”curl --fail-with-body \ "https://app-antla.com/api/headless/generations/c45451c0-b02c-4c90-8c6e-0779edb01996" \ -H "X-Antla-SDK-Key: YOUR_ANTLA_SDK_KEY"--fail-with-body stops on HTTP errors. A failed job is still HTTP 200. Read data.status.
Successful response
Section titled “Successful response”HTTP 200, JSON envelope:
{ "data": { "status": "SUCCESS", "storageStatus": "READY", "imageUrl": "https://cdn.example.com/result.jpg", "displayUrl": "https://provider.example.com/preview.jpg", "permanentUrl": "https://cdn.example.com/result.jpg", "imageId": 123, "tryOnUuid": "try-on-uuid", "requestsLeft": 2, "totalRequests": 1, "uniqueUserId": "visitor-id" }}requestsLeft and totalRequests describe the email gate, not merchant credits. In this example, 1 try-on is already counted and 2 remain before email is required. When the visitor already has an email, or email collection is off, requestsLeft is -1.
Other response states
Section titled “Other response states”{ "data": { "status": "PROCESSING" } }{ "data": { "status": "SUCCESS", "storageStatus": "PENDING", "imageUrl": "https://provider.example.com/preview.jpg", "displayUrl": "https://provider.example.com/preview.jpg", "permanentUrl": null, "imageId": null, "tryOnUuid": null, "requestsLeft": 2, "totalRequests": 1, "uniqueUserId": "visitor-id" }}{ "data": { "status": "ERROR", "error": "Generation failed" } }All these job states use HTTP 200. For SUCCESS / PENDING, you can display a temporary preview, but must keep polling.
A storage failure comes back as status: "ERROR". Keep polling while storageStatus is PENDING. At READY, use permanentUrl or imageUrl. A success body with no storageStatus and a usable imageUrl is final.
An unknown job and a job from another store both return HTTP 404. uniqueUserId changes the counters in the response. It does not decide which job you can read.
Errors
Section titled “Errors”400 for an invalid job ID or an empty uniqueUserId. 404 Generation not found. 500 when the stored result cannot be read. A job failure is HTTP 200 with data.status ERROR. Retries are in Errors and rate limits.