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
| Field | Type | Description |
|---|---|---|
| idreq | string | Persona id (uuid). |
| pidreq | string | Portrait id (uuid). |
Request body
| Field | Type | Description |
|---|---|---|
| instructionreq | string |
Responses
200Edit applied
Body
| Field | Type | Description |
|---|---|---|
| portraitIdreq | string | |
| conversationIdreq | string | |
| statusreq | string · "pending" | "generating" | "generated" | "approved" | "rejected" | "failed" | |
| storageKeyreq | string | |
| signedUrlreq | string |
404Source portrait not found / not in editable state
Body
| Field | Type | Description |
|---|---|---|
| errorreq | string | |
| message | string | |
| used | number | |
| limit | number | |
| pii | string[] | |
| term | string | |
| scores | object | |
| provider | string |
422Moderation rejected
Body
| Field | Type | Description |
|---|---|---|
| errorreq | string | |
| message | string | |
| used | number | |
| limit | number | |
| pii | string[] | |
| term | string | |
| scores | object | |
| provider | string |
502Upstream provider error
Body
| Field | Type | Description |
|---|---|---|
| errorreq | string | |
| message | string | |
| used | number | |
| limit | number | |
| pii | string[] | |
| term | string | |
| scores | object | |
| provider | string |
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>",
)