deleteEntity
Hard-delete an entity by ULID, removing its derived data and audit-tombstoning it; active relations block deletion unless cascade=true is set.
Instructions
Hard-delete an entity by ULID: removes the entity and all its derived data (relations, facts, mentions, identifiers, citations) and detaches its graph node, appending an entityDeleted tombstone to the audit log. This is for unwanted or junk entities — to consolidate DUPLICATES without losing data use mergeEntities instead. Safe default: refuses with E_VALIDATION when the entity still has active relations (so a connected entity is never dropped by accident); pass cascade=true to tombstone those relations first and proceed. Returns E_NOT_FOUND when the uid is unknown.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | Optional free-text reason for the deletion. Surfaced in audit/log views and stamped on the cascaded relationForgotten tombstones. | |
| cascade | No | Delete the entity even when it still has active relations. When true, each active relation is first tombstoned (relationForgotten) for the audit trail, then the entity and all its remaining derived data (facts, mentions, identifiers, citations) are removed. When false (default) the delete is REFUSED if any active relation exists, so a well-connected entity is never dropped by accident — merge it with mergeEntities instead, or pass cascade to confirm. Defaults to false. | |
| entityUid | Yes | ULID of the entity to delete. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | AIP resource name of the deleted entity. | |
| status | Yes | Always "deleted" on success. | |
| forgottenRelations | No | Number of active relations tombstoned by the cascade before the entity was removed (0 unless cascade was needed). |