Skip to main content

Summary

Split a paragraph at a visible-text offset, producing two paragraphs. Preserves unambiguous simple run properties around the cut. Rejects when the paragraph contains fields, content controls, drawings, equations, or unsupported tracked-change wrappers. Available on v2-backed sessions only; v1-backed sessions currently return CAPABILITY_UNAVAILABLE.
  • Operation ID: blocks.split
  • API member path: editor.doc.blocks.split(...)
  • Mutates document: yes
  • Idempotency: non-idempotent
  • Supports tracked mode: yes
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a BlocksSplitResult; on success carries the new tail paragraph address, affectedStories, and (for engines that report them) story-absolute textRangeShifts and a txId for history correlation.

Input fields

FieldTypeRequiredDescription
offsetintegeryes
targetBlockNodeAddressyesBlockNodeAddress
target.kind"block"yesConstant: "block"
target.nodeIdstringyes
target.nodeTypeenumyes"paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt"
target.storyStoryLocatornoStoryLocator

Example request

{
  "offset": 0,
  "target": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph",
    "story": {
      "kind": "story",
      "storyType": "body"
    }
  }
}

Output fields

FieldTypeRequiredDescription
affectedStoriesStoryLocator[]no
insertedBlockNodeAddressyesBlockNodeAddress
inserted.kind"block"yesConstant: "block"
inserted.nodeIdstringyes
inserted.nodeTypeenumyes"paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt"
inserted.storyStoryLocatornoStoryLocator
remappedRefsAffectedRefRemapping[]no
successtrueyesConstant: true
textRangeShiftsTextRangeShift[]no
txIdstringno

Example response

{
  "affectedStories": [
    {
      "kind": "story",
      "storyType": "body"
    }
  ],
  "inserted": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph",
    "story": {
      "kind": "story",
      "storyType": "body"
    }
  },
  "remappedRefs": [
    {
      "from": {
        "blockId": "block-abc123",
        "kind": "text",
        "range": {
          "end": 10,
          "start": 0
        },
        "story": {
          "kind": "story",
          "storyType": "body"
        }
      },
      "to": {
        "blockId": "block-abc123",
        "kind": "text",
        "range": {
          "end": 10,
          "start": 0
        },
        "story": {
          "kind": "story",
          "storyType": "body"
        }
      }
    }
  ],
  "success": true
}

Pre-apply throws

  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • INVALID_TARGET
  • INVALID_INPUT

Non-applied failure codes

  • INVALID_TARGET
  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • INVALID_CONTEXT
  • INVALID_INPUT

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "offset": {
      "minimum": 0,
      "type": "integer"
    },
    "target": {
      "$ref": "#/$defs/BlockNodeAddress"
    }
  },
  "required": [
    "target",
    "offset"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "affectedStories": {
      "items": {
        "$ref": "#/$defs/StoryLocator"
      },
      "type": "array"
    },
    "inserted": {
      "$ref": "#/$defs/BlockNodeAddress"
    },
    "remappedRefs": {
      "items": {
        "$ref": "#/$defs/AffectedRefRemapping"
      },
      "type": "array"
    },
    "success": {
      "const": true
    },
    "textRangeShifts": {
      "items": {
        "$ref": "#/$defs/TextRangeShift"
      },
      "type": "array"
    },
    "txId": {
      "type": "string"
    }
  },
  "required": [
    "success",
    "inserted"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "affectedStories": {
      "items": {
        "$ref": "#/$defs/StoryLocator"
      },
      "type": "array"
    },
    "inserted": {
      "$ref": "#/$defs/BlockNodeAddress"
    },
    "remappedRefs": {
      "items": {
        "$ref": "#/$defs/AffectedRefRemapping"
      },
      "type": "array"
    },
    "success": {
      "const": true
    },
    "textRangeShifts": {
      "items": {
        "$ref": "#/$defs/TextRangeShift"
      },
      "type": "array"
    },
    "txId": {
      "type": "string"
    }
  },
  "required": [
    "success",
    "inserted"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "enum": [
            "TARGET_NOT_FOUND",
            "CAPABILITY_UNAVAILABLE",
            "INVALID_TARGET",
            "INVALID_INPUT"
          ]
        },
        "details": {},
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "success": {
      "const": false
    }
  },
  "required": [
    "success",
    "failure"
  ],
  "type": "object"
}