Delete object
delete_objectDelete objects by ID from a document with reversible snapshot support. Requires approval token for confirmation.
Instructions
Delete objects by id from a document in ONE reversible, snapshot-backed operation.
When to use: dropping one or more existing elements (e.g. stray seed paths) without a Read +
set_document_svg full-document rebuild. Get ids from find_objects / inspect_document. To
MOVE an object into another group use reparent_object; to rename rather than remove use
rename_object.
Key params: object_ids is a non-empty list of ids to remove; an id that is not present is
silently skipped (deleting an already-absent object is a successful no-op, not an error). The
document root cannot be deleted. Because deletion is HIGH risk, a real removal requires a
non-empty approval_token (minted out of band, bound to this one operation); without it the
policy gate refuses the op and nothing is written.
Return shape: DeleteResult — all EditResult fields (operation_id, snapshot_id,
changed, before/after preview; the edit lands on the working copy only, reversible via
restore_snapshot) PLUS affected_ids, the ids that were actually removed. When NONE of the
ids existed the call is a genuine no-op: changed=False, empty operation_id/snapshot_id,
and affected_ids=[] (no snapshot or Operation Record written).
Example: delete_object(doc_id, ["seed1", "seed2"], approval_token="…")
Render and look before you trust this edit: render with render_preview (or live_render_view)
and inspect the result before relying on it; restore_snapshot reverts it if it is wrong.
Risk class: high (delete; approval-gated, reversible via pre-op snapshot — original untouched).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| object_ids | Yes | ||
| approval_token | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| changed | Yes | ||
| summary | No | ||
| snapshot_id | Yes | ||
| affected_ids | Yes | ||
| operation_id | Yes | ||
| preview_after | No | ||
| preview_before | No |