Skip to main content
PATCH
Update one of your models
Aggiorna i campi modificabili di un modello di proprietà della tua organizzazione e restituisce il modello aggiornato. name, default_prompt e instruction sono modificabili; i campi di proprietà e privacy non possono essere modificati. instruction è la guida sempre applicata del modello (max. 8000 caratteri), iniettata come direttiva obbligatoria (“MUST FOLLOW”) in ogni generazione di immagini e video che compone il modello — corrisponde allo user_instruction restituito in lettura del modello. Ometti un campo per lasciarlo invariato — non inviarlo come null esplicito (invia una stringa vuota per cancellare instruction). Gli id sconosciuti o di un’altra organizzazione restituiscono 404 not_found. Richiede lo scope models.write.

Autorizzazioni

Authorization
string
header
obbligatorio

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

Parametri del percorso

model_id
string<uuid>
obbligatorio

Corpo

application/json

PATCH /models/{id} body — the publicly editable fields only (ADR §10, ticket §3).

Ownership / privacy fields (owner_id, private, organization_id) are intentionally NOT accepted. A field may be omitted (left unchanged) but must not be sent as an explicit null — the runtime rejection lives in _reject_explicit_null (mirroring ApiKeyUpdate), and _string_only_patch_schema keeps the EXPORTED OpenAPI honest by advertising each field as a plain string (no null branch) so generated clients and the API playground cannot offer null as a value (SAM-639).

name
string

New model name.

Required string length: 1 - 100
Esempio:

"Renamed Model"

default_prompt
string

New default prompt / capability description.

Maximum string length: 2000
Esempio:

"A refined flat-design illustration in the Acme brand palette."

instruction
string

New always-applied model instruction (max 8000 chars) — injected into every generation that composes the model. Accepted on write under the name instruction (mirroring model creation); it maps to the user_instruction field returned on read (PublicModelDetail).

Maximum string length: 8000
Esempio:

"Always render on a clean, seamless white background."

Risposta

Successful Response

A single model with full detail — the GET /models/{id} body (ADR §10).

id
string<uuid>
obbligatorio
name
string
obbligatorio
Esempio:

"Acme Brand Style"

status
enum<string>
obbligatorio

Creation status: pending, processing, completed, or failed.

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

"completed"

is_ready
boolean
obbligatorio

True when the model is completed AND active — usable for generation.

Esempio:

true

created_at
string<date-time>
obbligatorio
updated_at
string<date-time>
obbligatorio
category
enum<string> | null

Model category — one of style, object, person, setting.

Opzioni disponibili:
style,
object,
person,
setting
Esempio:

"style"

thumbnail_url
string | null

Presigned, time-limited HTTPS thumbnail URL (null when the model has none).

Esempio:

"https://cdn.samsa.ai/models/…/thumbnail.webp?X-Amz-Signature=…"

reference_image_urls
string[]

Presigned, time-limited HTTPS URLs of the reference images used to create the model.

Esempio:
user_instruction
string | null

Free-text guidance for how to use the model.

Esempio:

"Use for hero banners and social posts."

default_prompt
string | null

The model's default prompt / capability description.

Esempio:

"A bold flat-design illustration in the Acme brand palette."

trigger_words
string[]

Trigger words associated with the model.

Esempio: