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

Summary

Retrieve a single node by target position.
  • Operation ID: getNode
  • API member path: editor.doc.getNode(...)
  • Mutates document: no
  • Idempotency: idempotent
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns an SDNodeResult envelope with the projected SDM/1 node and canonical address.

Input fields

Variant 1 (kind=“block”)

FieldTypeRequiredDescription
kind"block"yesConstant: "block"
nodeIdstringyes
nodeTypeenumyes"paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt"

Variant 2 (kind=“inline”)

FieldTypeRequiredDescription
anchorInlineAnchoryesInlineAnchor
anchor.endPositionyesPosition
anchor.end.blockIdstringyes
anchor.end.offsetintegeryes
anchor.startPositionyesPosition
anchor.start.blockIdstringyes
anchor.start.offsetintegeryes
kind"inline"yesConstant: "inline"
nodeTypeenumyes"run", "bookmark", "comment", "hyperlink", "sdt", "image", "footnoteRef", "endnoteRef", "crossRef", "indexEntry", "citation", "authorityEntry", "sequenceField", "tab", "lineBreak"

Example request

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

Output fields

FieldTypeRequiredDescription
addressNodeAddressyesNodeAddress
contextobjectno
nodeobjectyes

Example response

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

Pre-apply throws

  • TARGET_NOT_FOUND
  • ADDRESS_STALE

Non-applied failure codes

  • None

Raw schemas

{
  "$ref": "#/$defs/NodeAddress"
}
{
  "additionalProperties": false,
  "properties": {
    "address": {
      "$ref": "#/$defs/NodeAddress"
    },
    "context": {
      "type": "object"
    },
    "node": {
      "type": "object"
    }
  },
  "required": [
    "node",
    "address"
  ],
  "type": "object"
}