App öffnen
Moonborn — API · portraits

Set a portrait as the persona card (active) image

Activatable portraits must be in `generated` or `approved` status. Activation only updates the `personas.active_portrait_id` pointer — the canonical itself stays the identity anchor for future variants.

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

Responses

200Activated
Body
FieldTypeDescription
okreqobject
409Portrait not in an activatable status
Body
FieldTypeDescription
errorreqstring
messagestring
usednumber
limitnumber
piistring[]
termstring
scoresobject
providerstring
503Feature not configured
Body
FieldTypeDescription
errorreqstring
messagestring
usednumber
limitnumber
piistring[]
termstring
scoresobject
providerstring

Examples

cURL
curl -X POST https://api.moonborn.co/v1/personas/<id>/portrait/<pid>/activate \
  -H "Authorization: Bearer $MOONBORN_API_KEY"
TypeScript
import Moonborn from '@moonborn/sdk';

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

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

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

result = client.portraits.activate_persona_portrait(
    id="<id>",
    pid="<pid>",
)