Vai al contenuto principale
POST
Finish an image upload (verify the file, get a usable image_id)
Passaggio tre del caricamento di immagini, dopo il PUT sull’upload_url di POST /images/uploads/prepare. Chiamalo entro un’ora. Samsa verifica il file — presente, esattamente size_bytes, al massimo 10 MB, un’immagine leggibile del content_type preparato, al massimo 32 megapixel — e restituisce 200 OK con l’image_id, status: "completed" e width e height misurate. Da quel momento usa l’image_id come sorgente di una modifica, di un’operazione sulle immagini o di una generazione image-to-video.
Complete è idempotente: richiamarlo restituisce lo stesso risultato. Un file che non supera un controllo restituisce 422 e viene scartato — fai il PUT di un file valido sullo stesso upload_url finché è ancora valido e richiama complete. 409 upload_in_progress significa che un’altra chiamata complete è in corso: riprova tra qualche secondo. Richiede uno qualsiasi degli scope images.edit, images.transform o videos.generate. Gratuito.

Autorizzazioni

Authorization
string
header
obbligatorio

Organization API key (Authorization: Bearer samsa_sk_...) or OAuth 2.1 access token (Authorization: Bearer samsa_at_...).

Parametri del percorso

image_id
string<uuid>
obbligatorio

Risposta

Successful Response

200 body for POST /images/uploads/{image_id}/complete — the usable image.

image_id
string<uuid>
obbligatorio

Use as the source image_id in edits, img2img, variations, resizes, upscales, background removals, vectorizations and image-to-video generations.

status
string
obbligatorio

Always completed: the file is verified and the image can be used now. Thumbnails are built in the background.

Allowed value: "completed"
filename
string
obbligatorio

The filename given at prepare.

content_type
string
obbligatorio

The verified MIME type of the bytes.

size_bytes
integer
obbligatorio

Size of the uploaded file in bytes.

width
integer
obbligatorio

Width in pixels, measured from the bytes.

height
integer
obbligatorio

Height in pixels, measured from the bytes.