blocks.list
List top-level blocks in document order with IDs, types, text previews, and optional full text when includeText:true. Supports pagination via offset/limit, optional nodeType filtering, and single-story scoping via `in: StoryLocator`.
doc.blocks.list(…)Expected result
Returns a BlocksListResult with total block count, an ordered array of block entries (ordinal, nodeId, nodeType, textPreview, optional text, isEmpty), and the current document revision.
Inputs
inStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredFields
kind"section"requiredsectionIdstringrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequiredoffsetnumberNumber of blocks to skip. Default: 0.
limitnumberMaximum blocks to return. Omit for all blocks.
nodeTypes"paragraph" | "heading" | "listItem" | "table" | "tableRow" | "tableCell" | "tableOfContents" | "image" | "sdt"[]Filter by block types (e.g. ['paragraph', 'heading']). Omit for all types.
includeTextbooleanWhen true, includes the full flattened block text in each block entry.
Result
Output fields
totalnumberrequiredblocksobject[]requiredrevisionstringrequiredFailures
Pre-apply throws
INVALID_INPUTSTORY_NOT_FOUNDSTORY_MISMATCH
3 more codes
STORY_NOT_SUPPORTEDCROSS_STORY_PLANMATERIALIZATION_FAILED
Raw schemas
Open the generated JSON artifact for the exact input, output, success, and failure schemas represented by this contract version.
View raw JSON schemas