Document apiReferenceLists

lists.merge

Compound: merge two adjacent list sequences into one. Reassigns numId on the absorbed sequence (no strict abstractNumId check: absorbed items adopt the absorbing definition) and deletes empty paragraphs between the two sequences. Use this instead of lists.join for the user-facing "merge these lists" intent.

mutates documentdry runconditional
doc.lists.merge(…)

Expected result

Returns a ListsMergeResult with the merged listId, absorbedCount, and removedEmptyBlocks count.

Inputs

targetListItemAddressrequired
Fields
kind"block"required
nodeType"listItem"required
nodeIdstringrequired
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
direction"withPrevious" | "withNext"required

Result

Output fields
true
successtruerequired
listIdstringrequired
absorbedCountintegerrequired
removedEmptyBlocksintegerrequired
false
successfalserequired
failureobjectrequired
Fields
code"INVALID_TARGET" | "NO_ADJACENT_SEQUENCE" | "NO_OP"required
messagestringrequired
detailsunknown

Failures

Pre-apply throws

  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • INVALID_TARGET

Non-applied receipt codes

  • INVALID_TARGET
  • NO_ADJACENT_SEQUENCE
  • NO_OP

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