Skip to main content
GET
Retrieve a background-removal job's status and result
Recupera lo stato di un job di rimozione dello sfondo. Finché è pending o processing, continua a interrogare; una volta completed, la risposta include un singolo oggetto risultato image — un PNG trasparente con un presigned url valido per 24 ore. Un job in cache hit nasce completed con il suo risultato già allegato. Sono visibili solo i job creati dalla tua organizzazione; qualsiasi altro id restituisce 404 not_found. Richiede lo scope images.transform.

Esempio: job completato

L’image è un oggetto risultato di formato derivato; per la rimozione dello sfondo, model, width e height sono sempre null. Questo esempio è un cache hit, quindi credits_used è 0 (un miss normale mostra 1):
200 OK
Passa un webhook_url nella richiesta di rimozione dello sfondo originale per ricevere una callback firmata invece di interrogare — su un cache hit l’evento completed scatta immediatamente. Vedi Webhook.

Autorizzazioni

Authorization
string
header
obbligatorio

Organization API key as a bearer token: Authorization: Bearer samsa_sk_....

Parametri del percorso

background_removal_id
string<uuid>
obbligatorio

Risposta

Successful Response

GET /images/background-removals/{id} body (SAM-820 / S8.8 — ADR §7.2).

The standard async-job envelope plus ONE nullable image result object (an image_formats derivative — a transparent PNG — built by the S8.2 egress builder; model/width/height are always null for background removal). created_at is the job's submit time from the credit ledger (the image_generation_tasks table has no created_at column). A cache-hit job is born completed with a frozen result; a normal job progresses pending → processing → completed/failed.

id
string<uuid>
obbligatorio
status
enum<string>
obbligatorio

pending, processing, completed, failed, or cancelled.

Opzioni disponibili:
pending,
processing,
completed,
failed,
cancelled
Esempio:

"completed"

created_at
string<date-time>
obbligatorio

When the job was submitted.

credits_used
integer | null

Net credits charged for this job, after any refunds (0 for a cache hit).

Esempio:

1

image
PublicImageFormatResult · object | null

The produced transparent PNG (presigned URL); null until completed.

error
string | null

Failure detail when status is failed; otherwise null.