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

Summary

Retrieve a single node by its unique ID.
  • Operation ID: getNodeById
  • API member path: editor.doc.getNodeById(...)
  • 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

FieldTypeRequiredDescription
nodeIdstringyes
nodeTypeenumno"paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt"

Example request

{
  "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

Non-applied failure codes

  • None

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "nodeId": {
      "type": "string"
    },
    "nodeType": {
      "enum": [
        "paragraph",
        "heading",
        "listItem",
        "table",
        "tableRow",
        "tableCell",
        "tableOfContents",
        "image",
        "sdt"
      ]
    }
  },
  "required": [
    "nodeId"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "address": {
      "$ref": "#/$defs/NodeAddress"
    },
    "context": {
      "type": "object"
    },
    "node": {
      "type": "object"
    }
  },
  "required": [
    "node",
    "address"
  ],
  "type": "object"
}