Alpha: Document API is currently alpha and subject to breaking changes.
Summary
Delete a contiguous range of top-level blocks between two endpoints (inclusive). Both endpoints must be direct children of the document node. Supports dry-run preview.- Operation ID:
blocks.deleteRange - API member path:
editor.doc.blocks.deleteRange(...) - Mutates document:
yes - Idempotency:
conditional - Supports tracked mode:
no - Supports dry run:
yes - Deterministic target resolution:
yes
Expected result
Returns a BlocksDeleteRangeResult with deletedCount, deletedBlocks array (each with ordinal, nodeId, nodeType, textPreview), before/after revision, and dryRun flag.Input fields
| Field | Type | Required | Description |
|---|---|---|---|
end | BlockNodeAddress | yes | BlockNodeAddress |
end.kind | "block" | yes | Constant: "block" |
end.nodeId | string | yes | |
end.nodeType | enum | yes | "paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt" |
start | BlockNodeAddress | yes | BlockNodeAddress |
start.kind | "block" | yes | Constant: "block" |
start.nodeId | string | yes | |
start.nodeType | enum | yes | "paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt" |
Example request
Output fields
| Field | Type | Required | Description |
|---|---|---|---|
deletedBlocks | object[] | yes | |
deletedCount | number | yes | |
dryRun | boolean | yes | |
revision | object | yes | |
revision.after | string | yes | |
revision.before | string | yes | |
success | true | yes | Constant: true |
Example response
Pre-apply throws
TARGET_NOT_FOUNDAMBIGUOUS_TARGETINVALID_TARGETINVALID_INPUTCAPABILITY_UNAVAILABLEINTERNAL_ERROR
Non-applied failure codes
- None
Raw schemas
Raw input schema
Raw input schema
Raw output schema
Raw output schema
Raw success schema
Raw success schema
Raw failure schema
Raw failure schema

