> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superdoc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# blocks.deleteRange

> 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.

## 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"` |
| `end.story` | StoryLocator | no | StoryLocator |
| `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"` |
| `start.story` | StoryLocator | no | StoryLocator |

### Example request

```json theme={null}
{
  "end": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph",
    "story": {
      "kind": "story",
      "storyType": "body"
    }
  },
  "start": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph",
    "story": {
      "kind": "story",
      "storyType": "body"
    }
  }
}
```

## 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

```json theme={null}
{
  "deletedBlocks": [
    {
      "nodeId": "node-def456",
      "nodeType": "paragraph",
      "ordinal": 1,
      "textPreview": "example"
    }
  ],
  "deletedCount": 12.5,
  "dryRun": true,
  "revision": {
    "after": "example",
    "before": "example"
  },
  "success": true
}
```

## Pre-apply throws

* `TARGET_NOT_FOUND`
* `AMBIGUOUS_TARGET`
* `INVALID_TARGET`
* `INVALID_INPUT`
* `CAPABILITY_UNAVAILABLE`
* `INTERNAL_ERROR`
* `STORY_NOT_FOUND`
* `STORY_MISMATCH`
* `STORY_NOT_SUPPORTED`
* `CROSS_STORY_PLAN`
* `MATERIALIZATION_FAILED`

## Non-applied failure codes

* None

## Raw schemas

> [accordion] Raw input schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "end": {
>       "$ref": "#/$defs/BlockNodeAddress"
>     },
>     "start": {
>       "$ref": "#/$defs/BlockNodeAddress"
>     }
>   },
>   "required": [
>     "start",
>     "end"
>   ],
>   "type": "object"
> }
> ```

> [accordion] Raw output schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "deletedBlocks": {
>       "items": {
>         "additionalProperties": false,
>         "properties": {
>           "nodeId": {
>             "type": "string"
>           },
>           "nodeType": {
>             "type": "string"
>           },
>           "ordinal": {
>             "type": "number"
>           },
>           "textPreview": {
>             "oneOf": [
>               {
>                 "type": "string"
>               },
>               {
>                 "type": "null"
>               }
>             ]
>           }
>         },
>         "required": [
>           "ordinal",
>           "nodeId",
>           "nodeType",
>           "textPreview"
>         ],
>         "type": "object"
>       },
>       "type": "array"
>     },
>     "deletedCount": {
>       "type": "number"
>     },
>     "dryRun": {
>       "type": "boolean"
>     },
>     "revision": {
>       "additionalProperties": false,
>       "properties": {
>         "after": {
>           "type": "string"
>         },
>         "before": {
>           "type": "string"
>         }
>       },
>       "required": [
>         "before",
>         "after"
>       ],
>       "type": "object"
>     },
>     "success": {
>       "const": true
>     }
>   },
>   "required": [
>     "success",
>     "deletedCount",
>     "deletedBlocks",
>     "revision",
>     "dryRun"
>   ],
>   "type": "object"
> }
> ```

> [accordion] Raw success schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "deletedBlocks": {
>       "type": "array"
>     },
>     "deletedCount": {
>       "type": "number"
>     },
>     "dryRun": {
>       "type": "boolean"
>     },
>     "revision": {
>       "additionalProperties": false,
>       "properties": {
>         "after": {
>           "type": "string"
>         },
>         "before": {
>           "type": "string"
>         }
>       },
>       "required": [
>         "before",
>         "after"
>       ],
>       "type": "object"
>     },
>     "success": {
>       "const": true
>     }
>   },
>   "required": [
>     "success",
>     "deletedCount",
>     "deletedBlocks",
>     "revision",
>     "dryRun"
>   ],
>   "type": "object"
> }
> ```

> [accordion] Raw failure schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "failure": {
>       "additionalProperties": false,
>       "properties": {
>         "code": {
>           "enum": [
>             "TARGET_NOT_FOUND",
>             "AMBIGUOUS_TARGET",
>             "INVALID_TARGET",
>             "INVALID_INPUT",
>             "CAPABILITY_UNAVAILABLE",
>             "INTERNAL_ERROR",
>             "STORY_NOT_FOUND",
>             "STORY_MISMATCH",
>             "STORY_NOT_SUPPORTED",
>             "CROSS_STORY_PLAN",
>             "MATERIALIZATION_FAILED"
>           ]
>         },
>         "details": {},
>         "message": {
>           "type": "string"
>         }
>       },
>       "required": [
>         "code",
>         "message"
>       ],
>       "type": "object"
>     },
>     "success": {
>       "const": false
>     }
>   },
>   "required": [
>     "success",
>     "failure"
>   ],
>   "type": "object"
> }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.