Skip to main content
Alpha: Document API is currently alpha and subject to breaking changes.

Summary

  • 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

Input fields

FieldTypeRequiredDescription
targetDeletableBlockNodeAddressyesDeletableBlockNodeAddress

Example request

{
  "target": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph"
  }
}

Output fields

FieldTypeRequiredDescription
deletedDeletableBlockNodeAddressyesDeletableBlockNodeAddress
successtrueyesConstant: true

Example response

{
  "deleted": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph"
  },
  "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

{
  "additionalProperties": false,
  "properties": {
    "target": {
      "$ref": "#/$defs/DeletableBlockNodeAddress"
    }
  },
  "required": [
    "target"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "deleted": {
      "$ref": "#/$defs/DeletableBlockNodeAddress"
    },
    "success": {
      "const": true
    }
  },
  "required": [
    "success",
    "deleted"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "deleted": {
      "$ref": "#/$defs/DeletableBlockNodeAddress"
    },
    "success": {
      "const": true
    }
  },
  "required": [
    "success",
    "deleted"
  ],
  "type": "object"
}
{
  "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"
}