Uygulamayı aç
Moonborn — API · portraits

Soft-delete a canonical, variant, or edit portrait

Tombstone's a portrait row (`deleted_at` set; R2 binary kept). **Canonical cascade**: deleting the canonical also soft-deletes every variant and edit for the persona — variants are identity-locked to the canonical reference image, so leaving them orphaned would be misleading. Pointer cleanup: if the deleted row is referenced by `personas.canonical_portrait_id` or `personas.active_portrait_id`, the pointer is set to NULL (UI falls back to the gradient). Requires owner/admin/editor role.

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

Responses

200Deleted
Body
FieldTypeDescription
okreqobject
deletedIdsreqstring[]
cascadedreqboolean
canonicalPointerResetreqboolean
activePointerResetreqboolean
403Insufficient role (owner/admin/editor required)
Body
FieldTypeDescription
errorreqstring
messagestring
usednumber
limitnumber
piistring[]
termstring
scoresobject
providerstring
404Portrait or persona not found
Body
FieldTypeDescription
errorreqstring
messagestring
usednumber
limitnumber
piistring[]
termstring
scoresobject
providerstring
409Portrait does not belong to this persona
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 DELETE https://api.moonborn.co/v1/personas/<id>/portrait/<pid> \
  -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.deletePersonaPortrait({
  id: '<id>',
  pid: '<pid>',
});
Python
import os
from moonborn import Moonborn

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

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