Alpha: Document API is currently alpha and subject to breaking changes.
Summary
Insert a new caption paragraph adjacent to a target block.- Operation ID:
captions.insert - API member path:
editor.doc.captions.insert(...) - Mutates document:
yes - Idempotency:
non-idempotent - Supports tracked mode:
no - Supports dry run:
no - Deterministic target resolution:
yes
Expected result
Returns a CaptionMutationResult indicating success with the caption address or a failure.Input fields
| Field | Type | Required | Description |
|---|---|---|---|
adjacentTo | BlockNodeAddress | yes | BlockNodeAddress |
adjacentTo.kind | "block" | yes | Constant: "block" |
adjacentTo.nodeId | string | yes | |
adjacentTo.nodeType | enum | yes | "paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt" |
label | string | yes | |
position | enum | yes | "above", "below" |
text | string | no |
Example request
Output fields
Variant 1 (caption.kind=“block”)
| Field | Type | Required | Description |
|---|---|---|---|
caption | object(kind=“block”) | yes | |
caption.kind | "block" | yes | Constant: "block" |
caption.nodeId | string | yes | |
caption.nodeType | "paragraph" | yes | Constant: "paragraph" |
success | true | yes | Constant: true |
Variant 2 (success=false)
| Field | Type | Required | Description |
|---|---|---|---|
failure | object | yes | |
failure.code | string | yes | |
failure.details | any | no | |
failure.message | string | yes | |
success | false | yes | Constant: false |
Example response
Pre-apply throws
TARGET_NOT_FOUNDINVALID_TARGETINVALID_INPUTCAPABILITY_UNAVAILABLE
Non-applied failure codes
- None
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

