Skip to main content
GET
Retrieve a background-removal job's status and result
Récupère le statut d’un job de suppression d’arrière-plan. Tant qu’il est pending ou processing, continue d’interroger ; une fois completed, la réponse porte un seul objet résultat image — un PNG transparent avec une presigned url valable 24 heures. Un job en hit de cache naît completed avec son résultat déjà attaché. Seuls les jobs créés par ton organisation sont visibles ; tout autre id renvoie 404 not_found. Requiert le scope images.transform.

Exemple : job terminé

L’image est un objet résultat de format dérivé ; pour la suppression d’arrière-plan, model, width et height sont toujours null. Cet exemple est un hit de cache, donc credits_used vaut 0 (un miss normal affiche 1) :
200 OK
Passe un webhook_url sur la requête de suppression d’arrière-plan d’origine pour recevoir un callback signé au lieu d’interroger — sur un hit de cache, l’événement completed se déclenche immédiatement. Voir Webhooks.

Autorisations

Authorization
string
header
requis

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

Paramètres de chemin

background_removal_id
string<uuid>
requis

Réponse

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>
requis
status
enum<string>
requis

pending, processing, completed, failed, or cancelled.

Options disponibles:
pending,
processing,
completed,
failed,
cancelled
Exemple:

"completed"

created_at
string<date-time>
requis

When the job was submitted.

credits_used
integer | null

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

Exemple:

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.