Document apiReferenceCross refs

crossRefs.insert

Insert a new cross-reference field at a target location.

mutates documentdry runnon-idempotent
doc.crossRefs.insert(…)

Expected result

Returns a CrossRefMutationResult indicating success with the cross-reference address or a failure.

Inputs

atTextTargetrequired
Fields
kind"text"required
segmentsTextSegment[]required
storyStoryLocator

Story 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"required
storyType"body"required
headerFooterSlot
kind"story"required
storyType"headerFooterSlot"required
sectionSectionAddressrequired
headerFooterKind"header" | "footer"required
variant"default" | "first" | "even"required
resolution"effective" | "explicit"
onWrite"materializeIfInherited" | "editResolvedPart" | "error"
headerFooterPart
kind"story"required
storyType"headerFooterPart"required
refIdstringrequired
footnote
kind"story"required
storyType"footnote"required
noteIdstringrequired
endnote
kind"story"required
storyType"endnote"required
noteIdstringrequired
textbox
kind"story"required
storyType"textbox"required
textboxIdstringrequired
targetbookmark | heading | note | caption | numberedItem | styledParagraphrequired
bookmark
kind"bookmark"required
namestringrequired
heading
kind"heading"required
nodeIdstringrequired
note
kind"note"required
noteIdstringrequired
caption
kind"caption"required
nodeIdstringrequired
numberedItem
kind"numberedItem"required
nodeIdstringrequired
styledParagraph
kind"styledParagraph"required
styleNamestringrequired
direction"before" | "after"
display"content" | "pageNumber" | "noteNumber" | "labelAndNumber" | "aboveBelow" | "numberOnly" | "numberFullContext" | "styledContent" | "styledPageNumber"required

Result

Output fields
true
successtruerequired
crossRefobjectrequired
Fields
kind"inline"required
nodeType"crossRef"required
anchorInlineAnchorrequired
Fields
startPositionrequired
endPositionrequired
false
successfalserequired
failureobjectrequired
Fields
codestringrequired
messagestringrequired
detailsunknown

Failures

Pre-apply throws

  • TARGET_NOT_FOUND
  • INVALID_TARGET
  • INVALID_INPUT
1 more codes
  • CAPABILITY_UNAVAILABLE

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