Alpha: Document API is currently alpha and subject to breaking changes.
Summary
Insert a new list at the target position.- Operation ID:
lists.insert - API member path:
editor.doc.lists.insert(...) - Mutates document:
yes - Idempotency:
non-idempotent - Supports tracked mode:
yes - Supports dry run:
yes - Deterministic target resolution:
yes
Expected result
Returns a ListsInsertResult with the new list item address and block ID.Input fields
| Field | Type | Required | Description |
|---|---|---|---|
position | enum | yes | "before", "after" |
target | ListItemAddress | yes | ListItemAddress |
target.kind | "block" | yes | Constant: "block" |
target.nodeId | string | yes | |
target.nodeType | "listItem" | yes | Constant: "listItem" |
text | string | no |
Example request
Output fields
Variant 1 (item.kind=“block”)
| Field | Type | Required | Description |
|---|---|---|---|
insertionPoint | TextAddress | yes | TextAddress |
insertionPoint.blockId | string | yes | |
insertionPoint.kind | "text" | yes | Constant: "text" |
insertionPoint.range | Range | yes | Range |
insertionPoint.range.end | integer | yes | |
insertionPoint.range.start | integer | yes | |
item | ListItemAddress | yes | ListItemAddress |
item.kind | "block" | yes | Constant: "block" |
item.nodeId | string | yes | |
item.nodeType | "listItem" | yes | Constant: "listItem" |
success | true | yes | Constant: true |
trackedChangeRefs | TrackedChangeAddress[] | no |
Variant 2 (success=false)
| Field | Type | Required | Description |
|---|---|---|---|
failure | object | yes | |
failure.code | enum | yes | "INVALID_TARGET" |
failure.details | any | no | |
failure.message | string | yes | |
success | false | yes | Constant: false |
Example response
Pre-apply throws
TARGET_NOT_FOUNDCAPABILITY_UNAVAILABLEINVALID_TARGET
Non-applied failure codes
INVALID_TARGET
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

