Uygulamayı aç
Moonborn — API · portraits

Apply a single natural-language edit to an existing portrait

Source portrait (canonical / variant / earlier edit) is provided to the provider as an inline reference; the instruction (≤ 500 chars) drives the edit. Each call appends a new row in the same `conversation_id` chain so the UI can branch or undo.

POST/v1/personas/{id}/portrait/{pid}/editscope · Bearer (API key or session JWT)
Path parameters
FieldTypeDescription
idreqstringPersona id (uuid).
pidreqstringPortrait id (uuid).
Request body
FieldTypeDescription
instructionreqstring

Responses

200Edit applied
Body
FieldTypeDescription
portraitIdreqstring
conversationIdreqstring
statusreqstring · "pending" | "generating" | "generated" | "approved" | "rejected" | "failed"
storageKeyreqstring
signedUrlreqstring
404Source portrait not found / not in editable state
Body
FieldTypeDescription
errorreqstring
messagestring
usednumber
limitnumber
piistring[]
termstring
scoresobject
providerstring
422Moderation rejected
Body
FieldTypeDescription
errorreqstring
messagestring
usednumber
limitnumber
piistring[]
termstring
scoresobject
providerstring
502Upstream provider error
Body
FieldTypeDescription
errorreqstring
messagestring
usednumber
limitnumber
piistring[]
termstring
scoresobject
providerstring

Examples

cURL
curl -X POST https://api.moonborn.co/v1/personas/<id>/portrait/<pid>/edit \
  -H "Authorization: Bearer $MOONBORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "instruction": "<string>"
    }'
TypeScript
import Moonborn from '@moonborn/sdk';

const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });

const result = await client.portraits.editPersonaPortrait({
  id: '<id>',
  pid: '<pid>',
  instruction: "<string>",
});
Python
import os
from moonborn import Moonborn

client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])

result = client.portraits.edit_persona_portrait(
    id="<id>",
    pid="<pid>",
    instruction="<string>",
)