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
| Field | Type | Description |
|---|---|---|
| idreq | string | Persona id (uuid). |
| pidreq | string | Portrait id (uuid). |
Responses
200Deleted
Body
| Field | Type | Description |
|---|---|---|
| okreq | object | |
| deletedIdsreq | string[] | |
| cascadedreq | boolean | |
| canonicalPointerResetreq | boolean | |
| activePointerResetreq | boolean |
403Insufficient role (owner/admin/editor required)
Body
| Field | Type | Description |
|---|---|---|
| errorreq | string | |
| message | string | |
| used | number | |
| limit | number | |
| pii | string[] | |
| term | string | |
| scores | object | |
| provider | string |
404Portrait or persona not found
Body
| Field | Type | Description |
|---|---|---|
| errorreq | string | |
| message | string | |
| used | number | |
| limit | number | |
| pii | string[] | |
| term | string | |
| scores | object | |
| provider | string |
409Portrait does not belong to this persona
Body
| Field | Type | Description |
|---|---|---|
| errorreq | string | |
| message | string | |
| used | number | |
| limit | number | |
| pii | string[] | |
| term | string | |
| scores | object | |
| provider | string |
503Feature not configured
Body
| Field | Type | Description |
|---|---|---|
| errorreq | string | |
| message | string | |
| used | number | |
| limit | number | |
| pii | string[] | |
| term | string | |
| scores | object | |
| provider | string |
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>",
)