Loading documentation…
Loading documentation…
Create preparation work once and read its durable status.
POST /v2/images/resolve with X-API-Key, JSON selection and an optional stable Idempotency-Key. HTTP 202 means preparation is pending with no requested variant ready. HTTP 200 may be ready, partial or terminally failed. Always inspect data.variants, data.status and data.settled.
For pending work, wait for Retry-After and GET the exact relative Location or data.status_url on the same API origin, with the same workload authentication. The URL preserves size, format and recipe selection. GET returns 200 while processing; stop only when settled, on a terminal error, or at your application's deadline. Use retry_after_seconds plus bounded jitter between polls.
Polling does not create work. A 409 image_variants_not_requested means you must resolve that selection first. An API dependency outage is not evidence that previously accepted work failed; retain its status URL and retry within your deadline. Optional Images notifications are not required for this workflow.
A local polling deadline stops your client waiting; it does not cancel preparation or prove failure. Retain the exact returned status URL, its owning Project and Service Account, the last response state, and when you last checked. Keep ready variant URLs separately from variants whose readiness is still unconfirmed.
Show a state such as “Image readiness not yet confirmed” with the last-check time when checks pause. Do not display an old processing response as a fresh observation, and do not turn a timeout into a terminal preparation failure.
When the application next needs the image, resume GET requests to that same status URL with a new finite time and attempt budget. Honor Retry-After when supplied, otherwise use the response's retry_after_seconds, and add bounded jitter. Limit reconciliation concurrency across images and coordinate the shared Service Account request budget. Update the stored state from each fresh response; stop when data.settled is true and handle failed variants separately from ready ones.
Do not submit resolve or batch work again merely because a local deadline expired. Pause on 401/403 until valid access is restored. For temporary 429/503 responses, retain accepted work and retry only within the reconciliation budget. If readiness remains unconfirmed, preserve it for a later bounded check instead of starting an unbounded background loop.
For an uncertain POST response, repeat the same body and idempotency key. A 409 idempotency_replay provides error.detail.original_request_id and, when recoverable, error.detail.status_url. Follow the status link. Do not rotate keys on every retry: that creates separate operation identities.