Document apiReferenceFormatParagraph

format.paragraph.applyBatch

Apply an explicit ordered paragraph action program target-major to 1..1000 unique existing targets in one story, atomically. Accepts 1..1000 closed actions, at most 32000 expanded writer calls and 1048576 JSON bytes, cumulative across batches in an atomic plan. Uses existing writer validation; omitted groups are preserved. No nested plans, per-action targets/options or dry run. Expected revision is consumed once at batch start; live freshness is checked again before publication. Shared sessions support direct identity-preserving writes only.

mutates documentconditional
doc.format.paragraph.applyBatch(…)

Expected result

Resolves to ParagraphBatchMutationResult with resolution.targets, applied mode and tracked refs when committed, or indexed failure details. An all-no-op batch succeeds without revision, publication or history. Standalone commits once; inside an atomic plan shares its one preparation, publication and Undo/Redo unit.

Inputs

targetsparagraph | heading | listItem[]required
operationsstyles.paragraph.setStyleRef | styles.paragraph.clearStyle | format.paragraph.setAlignment | format.paragraph.clearAlignment | format.paragraph.setSpacing | format.paragraph.clearSpacing | format.paragraph.setIndentation | format.paragraph.clearIndentation | format.paragraph.setKeepOptions | format.paragraph.setFlowOptions | format.paragraph.setOutlineLevel | format.paragraph.setBorder | format.paragraph.clearBorder | format.paragraph.setShading | format.paragraph.clearShading | format.paragraph.setTabStop | format.paragraph.clearAllTabStops | format.paragraph.setDirection | format.paragraph.clearDirection | format.paragraph.setMarkRunProps[]required

Result

Output fields
true
successtruerequired
resolutionobjectrequired
Fields
targetsparagraph | heading | listItem[]required
appliedChangeMode"direct" | "tracked"
trackedChangeRefsTrackedChangeAddress[]
false
successfalserequired
failureobjectrequired
Fields
code"INVALID_INPUT" | "TARGET_NOT_FOUND" | "REVISION_MISMATCH" | "PERMISSION_DENIED" | "CAPABILITY_UNAVAILABLE" | "PRECONDITION_FAILED"required
messagestringrequired
detailsunknown
resolutionobject
Fields
targetparagraph | heading | listItemrequired
paragraph
kind"block"required
nodeType"paragraph"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
heading
kind"block"required
nodeType"heading"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
listItem
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

Failures

Pre-apply throws

  • TARGET_NOT_FOUND
  • INVALID_TARGET
  • CAPABILITY_UNAVAILABLE

Non-applied receipt codes

  • INVALID_INPUT
  • TARGET_NOT_FOUND
  • REVISION_MISMATCH
3 more codes
  • PERMISSION_DENIED
  • CAPABILITY_UNAVAILABLE
  • PRECONDITION_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