> ## Documentation Index
> Fetch the complete documentation index at: https://superdoc-caio-pizzol-docs-ai-core-preset.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# blocks.delete

> Delete an entire block node (paragraph, heading, list item, table, image, or sdt) deterministically.

## Summary

Delete an entire block node (paragraph, heading, list item, table, image, or sdt) deterministically.

* Operation ID: `blocks.delete`
* API member path: `editor.doc.blocks.delete(...)`
* Mutates document: `yes`
* Idempotency: `conditional`
* Supports tracked mode: `no`
* Supports dry run: `yes`
* Deterministic target resolution: `yes`

## Expected result

Returns a BlocksDeleteResult receipt confirming the block was removed, including a deletedBlock summary with ordinal, nodeType, and textPreview.

## Input fields

| Field             | Type                      | Required | Description                                                  |
| ----------------- | ------------------------- | -------- | ------------------------------------------------------------ |
| `target`          | DeletableBlockNodeAddress | yes      | DeletableBlockNodeAddress                                    |
| `target.kind`     | `"block"`                 | yes      | Constant: `"block"`                                          |
| `target.nodeId`   | string                    | yes      |                                                              |
| `target.nodeType` | enum                      | yes      | `"paragraph"`, `"heading"`, `"listItem"`, `"table"`, `"sdt"` |

### Example request

```json theme={null}
{
  "target": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph"
  }
}
```

## Output fields

| Field                      | Type                      | Required | Description                                                  |
| -------------------------- | ------------------------- | -------- | ------------------------------------------------------------ |
| `deleted`                  | DeletableBlockNodeAddress | yes      | DeletableBlockNodeAddress                                    |
| `deleted.kind`             | `"block"`                 | yes      | Constant: `"block"`                                          |
| `deleted.nodeId`           | string                    | yes      |                                                              |
| `deleted.nodeType`         | enum                      | yes      | `"paragraph"`, `"heading"`, `"listItem"`, `"table"`, `"sdt"` |
| `deletedBlock`             | object                    | no       |                                                              |
| `deletedBlock.nodeId`      | string                    | no       |                                                              |
| `deletedBlock.nodeType`    | string                    | no       |                                                              |
| `deletedBlock.ordinal`     | number                    | no       |                                                              |
| `deletedBlock.textPreview` | string \| null            | no       | One of: string, null                                         |
| `success`                  | `true`                    | yes      | Constant: `true`                                             |

### Example response

```json theme={null}
{
  "deleted": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph"
  },
  "deletedBlock": {
    "nodeId": "node-def456",
    "ordinal": 1
  },
  "success": true
}
```

## Pre-apply throws

* `TARGET_NOT_FOUND`
* `AMBIGUOUS_TARGET`
* `CAPABILITY_UNAVAILABLE`
* `INVALID_TARGET`
* `INVALID_INPUT`
* `INTERNAL_ERROR`

## Non-applied failure codes

* None

## Raw schemas

<Accordion title="Raw input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "target": {
        "$ref": "#/$defs/DeletableBlockNodeAddress"
      }
    },
    "required": [
      "target"
    ],
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw output schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "deleted": {
        "$ref": "#/$defs/DeletableBlockNodeAddress"
      },
      "deletedBlock": {
        "additionalProperties": false,
        "properties": {
          "nodeId": {
            "type": "string"
          },
          "nodeType": {
            "type": "string"
          },
          "ordinal": {
            "type": "number"
          },
          "textPreview": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "success": {
        "const": true
      }
    },
    "required": [
      "success",
      "deleted"
    ],
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw success schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "deleted": {
        "$ref": "#/$defs/DeletableBlockNodeAddress"
      },
      "deletedBlock": {
        "additionalProperties": false,
        "properties": {
          "nodeId": {
            "type": "string"
          },
          "nodeType": {
            "type": "string"
          },
          "ordinal": {
            "type": "number"
          },
          "textPreview": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "success": {
        "const": true
      }
    },
    "required": [
      "success",
      "deleted"
    ],
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw failure schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "failure": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "enum": [
              "TARGET_NOT_FOUND",
              "AMBIGUOUS_TARGET",
              "CAPABILITY_UNAVAILABLE",
              "INVALID_TARGET",
              "INVALID_INPUT",
              "INTERNAL_ERROR"
            ]
          },
          "details": {},
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "success": {
        "const": false
      }
    },
    "required": [
      "success",
      "failure"
    ],
    "type": "object"
  }
  ```
</Accordion>
