Retrieve an image edit's status and results
curl --request GET \
--url https://api.samsa.ai/public/v1/images/edits/{edit_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.samsa.ai/public/v1/images/edits/{edit_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.samsa.ai/public/v1/images/edits/{edit_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.samsa.ai/public/v1/images/edits/{edit_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.samsa.ai/public/v1/images/edits/{edit_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.samsa.ai/public/v1/images/edits/{edit_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.samsa.ai/public/v1/images/edits/{edit_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"created_at": "2023-11-07T05:31:56Z",
"credits_used": 5,
"images": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "https://cdn.samsa.ai/user-.../abc.png?X-Amz-Signature=...",
"thumbnail_url": "<string>",
"width": 123,
"height": 123,
"seed": 123
}
],
"error": "<string>"
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}Modifica di immagini
Ottieni una modifica di immagine
Interroga un job Magic Edit per lo stato e, una volta completato, per le immagini modificate.
GET
/
images
/
edits
/
{edit_id}
Retrieve an image edit's status and results
curl --request GET \
--url https://api.samsa.ai/public/v1/images/edits/{edit_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.samsa.ai/public/v1/images/edits/{edit_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.samsa.ai/public/v1/images/edits/{edit_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.samsa.ai/public/v1/images/edits/{edit_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.samsa.ai/public/v1/images/edits/{edit_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.samsa.ai/public/v1/images/edits/{edit_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.samsa.ai/public/v1/images/edits/{edit_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"created_at": "2023-11-07T05:31:56Z",
"credits_used": 5,
"images": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "https://cdn.samsa.ai/user-.../abc.png?X-Amz-Signature=...",
"thumbnail_url": "<string>",
"width": 123,
"height": 123,
"seed": 123
}
],
"error": "<string>"
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}Recupera lo stato di un job Magic Edit. Mentre è
pending o processing,
continua a interrogare; una volta completed, la risposta include le immagini
modificate, ognuna con un url presigned valido per 24 ore. Sono visibili
solo i job di modifica creati dalla tua organizzazione; qualsiasi altro id
restituisce 404 not_found.
Passa un
webhook_url nella richiesta di modifica
originale per ricevere una callback firmata invece di interrogare. Vedi
Webhook.Autorizzazioni
Organization API key as a bearer token: Authorization: Bearer samsa_sk_....
Parametri del percorso
Risposta
Successful Response
GET /images/edits/{id} body — same contract as image generation.
Both are backed by image_generation_tasks; a distinct name for the docs.
pending, processing, completed, failed, or cancelled.
Opzioni disponibili:
pending, processing, completed, failed, cancelled Esempio:
"completed"
When the job was submitted.
Net credits charged for this job, after any refunds.
Esempio:
5
Produced images (presigned URLs); empty until completed.
Show child attributes
Show child attributes
Failure detail when status is failed; otherwise null.

