Document apiReferenceCreate
create.tableOfContents
Insert a new table of contents at the target position.
mutates documentdry runnon-idempotent
doc.create.tableOfContents(…)Expected result
Returns a CreateTableOfContentsResult with the new TOC block address.
Inputs
atdocumentStart | documentEnd | before | afterdocumentStart
kind"documentStart"requireddocumentEnd
kind"documentEnd"requiredbefore
kind"before"requiredtargetBlockNodeAddressrequiredFields
kind"block"requirednodeType"paragraph" | "heading" | "listItem" | "table" | "tableRow" | "tableCell" | "tableOfContents" | "image" | "sdt"requirednodeIdstringrequiredstoryStoryLocatorStory 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"requiredsectionSectionAddressrequiredheaderFooterKind"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"requiredtextboxIdstringrequiredafter
kind"after"requiredtargetBlockNodeAddressrequiredFields
kind"block"requirednodeType"paragraph" | "heading" | "listItem" | "table" | "tableRow" | "tableCell" | "tableOfContents" | "image" | "sdt"requirednodeIdstringrequiredstoryStoryLocatorStory 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"requiredsectionSectionAddressrequiredheaderFooterKind"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"requiredtextboxIdstringrequiredconfigobjectFields
outlineLevelsobjectFields
fromintegerrequiredtointegerrequireduseAppliedOutlineLevelbooleantcFieldIdentifierstringtcFieldLevelsobjectFields
fromintegerrequiredtointegerrequiredhyperlinksbooleanhideInWebViewbooleanomitPageNumberLevelsobjectFields
fromintegerrequiredtointegerrequiredseparatorstringincludePageNumbersbooleantabLeader"none" | "dot" | "hyphen" | "underscore" | "middleDot"rightAlignPageNumbersbooleaninstructionstringResult
Output fields
true
successtruerequiredtocobjectrequiredFields
kind"block"requirednodeType"tableOfContents"requirednodeIdstringrequiredfalse
successfalserequiredfailureobjectrequiredFields
code"NO_OP" | "INVALID_TARGET" | "TARGET_NOT_FOUND" | "CAPABILITY_UNAVAILABLE" | "INVALID_INSERTION_CONTEXT" | "PAGE_NUMBERS_NOT_MATERIALIZED"requiredmessagestringrequireddetailsunknownFailures
Pre-apply throws
INVALID_TARGETTARGET_NOT_FOUNDINVALID_INPUT
1 more codes
CAPABILITY_UNAVAILABLE
Non-applied receipt codes
NO_OPINVALID_INSERTION_CONTEXT
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