Skip to main content

Summary

Read the numbering-aware list state for a paragraph (numId, ilvl, abstract reference, level format). Returns null when the target is not a list item. Available on v2-backed sessions only; v1-backed sessions currently return CAPABILITY_UNAVAILABLE.
  • Operation ID: lists.getState
  • API member path: editor.doc.lists.getState(...)
  • Mutates document: no
  • Idempotency: idempotent
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a ListsGetStateResult with isListItem plus numId/ilvl/abstract/numFmt metadata when present.

Input fields

FieldTypeRequiredDescription
targetobject(kind=“block”) | object(kind=“block”)yesOne of: object(kind=“block”), object(kind=“block”)

Example request

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

Output fields

Variant 1 (success=true)

FieldTypeRequiredDescription
abstractNumIdstring | nullno
ilvlintegeryes
isListItembooleanyes
lvlTextstring | nullno
numFmtstring | nullno
numIdstring | nullno
seedenum | nullno"bullet", "ordered", null
successtrueyesConstant: true

Variant 2 (success=false)

FieldTypeRequiredDescription
failureobjectyes
failure.codeenumyes"TARGET_NOT_FOUND", "CAPABILITY_UNAVAILABLE"
failure.detailsanyno
failure.messagestringyes
successfalseyesConstant: false

Example response

{
  "abstractNumId": null,
  "ilvl": 1,
  "isListItem": true,
  "numId": null,
  "success": true
}

Pre-apply throws

  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE

Non-applied failure codes

  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "target": {
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "block"
            },
            "nodeId": {
              "type": "string"
            },
            "nodeType": {
              "const": "paragraph"
            }
          },
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "block"
            },
            "nodeId": {
              "type": "string"
            },
            "nodeType": {
              "const": "listItem"
            }
          },
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ],
          "type": "object"
        }
      ]
    }
  },
  "required": [
    "target"
  ],
  "type": "object"
}
{
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "abstractNumId": {
          "type": [
            "string",
            "null"
          ]
        },
        "ilvl": {
          "minimum": 0,
          "type": "integer"
        },
        "isListItem": {
          "type": "boolean"
        },
        "lvlText": {
          "type": [
            "string",
            "null"
          ]
        },
        "numFmt": {
          "type": [
            "string",
            "null"
          ]
        },
        "numId": {
          "type": [
            "string",
            "null"
          ]
        },
        "seed": {
          "enum": [
            "bullet",
            "ordered",
            null
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "success": {
          "const": true
        }
      },
      "required": [
        "success",
        "isListItem",
        "ilvl"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "failure": {
          "additionalProperties": false,
          "properties": {
            "code": {
              "enum": [
                "TARGET_NOT_FOUND",
                "CAPABILITY_UNAVAILABLE"
              ]
            },
            "details": {},
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object"
        },
        "success": {
          "const": false
        }
      },
      "required": [
        "success",
        "failure"
      ],
      "type": "object"
    }
  ]
}