Skip to main content
This reference is sourced from packages/document-api/src/contract/*. Document API is currently alpha and subject to breaking changes.

Browse by namespace

NamespaceCanonical opsAliasesTotal surfaceReference
Core10010Open
Blocks101Open
Capabilities101Open
Create606Open
Sections18018Open
Format44145Open
Styles101Open
Lists17017Open
Comments505Open
Track Changes303Open
Query101Open
Mutations202Open
Paragraph Formatting17017Open
Paragraph Styles202Open
Tables42042Open
History303Open
Table of Contents10010Open
Images13013Open

Available operations

The tables below are grouped by namespace.

Core

OperationAPI member pathDescription
findeditor.doc.find(…)Search the document for nodes matching type, text, or attribute criteria.
getNodeeditor.doc.getNode(…)Retrieve a single node by target position.
getNodeByIdeditor.doc.getNodeById(…)Retrieve a single node by its unique ID.
getTexteditor.doc.getText(…)Extract the plain-text content of the document.
getMarkdowneditor.doc.getMarkdown(…)Extract the document content as a Markdown string.
getHtmleditor.doc.getHtml(…)Extract the document content as an HTML string.
infoeditor.doc.info(…)Return document metadata including revision, node count, and capabilities.
inserteditor.doc.insert(…)Insert content at a target position, or at the end of the document when target is omitted. Supports text (default), markdown, and html content types via the type field.
replaceeditor.doc.replace(…)Replace content at a target position with new text or inline content.
deleteeditor.doc.delete(…)Delete content at a target position.

Blocks

OperationAPI member pathDescription
blocks.deleteeditor.doc.blocks.delete(…)Delete an entire block node (paragraph, heading, list item, table, image, or sdt) deterministically.

Capabilities

OperationAPI member pathDescription
capabilities.geteditor.doc.capabilities()Query runtime capabilities supported by the current document engine.

Create

OperationAPI member pathDescription
create.paragrapheditor.doc.create.paragraph(…)Create a new paragraph at the target position.
create.headingeditor.doc.create.heading(…)Create a new heading at the target position.
create.sectionBreakeditor.doc.create.sectionBreak(…)Create a section break at the target location with optional initial section properties.
create.tableeditor.doc.create.table(…)Create a new table at the target position.
create.tableOfContentseditor.doc.create.tableOfContents(…)Insert a new table of contents at the target position.
create.imageeditor.doc.create.image(…)Insert a new image at the target position.

Sections

OperationAPI member pathDescription
sections.listeditor.doc.sections.list(…)List sections in deterministic order with section-target handles.
sections.geteditor.doc.sections.get(…)Retrieve full section information by section address.
sections.setBreakTypeeditor.doc.sections.setBreakType(…)Set the section break type.
sections.setPageMarginseditor.doc.sections.setPageMargins(…)Set page-edge margins for a section.
sections.setHeaderFooterMarginseditor.doc.sections.setHeaderFooterMargins(…)Set header/footer margin distances for a section.
sections.setPageSetupeditor.doc.sections.setPageSetup(…)Set page size/orientation properties for a section.
sections.setColumnseditor.doc.sections.setColumns(…)Set column configuration for a section.
sections.setLineNumberingeditor.doc.sections.setLineNumbering(…)Enable or configure line numbering for a section.
sections.setPageNumberingeditor.doc.sections.setPageNumbering(…)Set page numbering format/start for a section.
sections.setTitlePageeditor.doc.sections.setTitlePage(…)Enable or disable title-page behavior for a section.
sections.setOddEvenHeadersFooterseditor.doc.sections.setOddEvenHeadersFooters(…)Enable or disable odd/even header-footer mode in document settings.
sections.setVerticalAligneditor.doc.sections.setVerticalAlign(…)Set vertical page alignment for a section.
sections.setSectionDirectioneditor.doc.sections.setSectionDirection(…)Set section text flow direction (LTR/RTL).
sections.setHeaderFooterRefeditor.doc.sections.setHeaderFooterRef(…)Set or replace a section header/footer reference for a variant.
sections.clearHeaderFooterRefeditor.doc.sections.clearHeaderFooterRef(…)Clear a section header/footer reference for a specific variant.
sections.setLinkToPreviouseditor.doc.sections.setLinkToPrevious(…)Set or clear link-to-previous behavior for a header/footer variant.
sections.setPageBorderseditor.doc.sections.setPageBorders(…)Set page border configuration for a section.
sections.clearPageBorderseditor.doc.sections.clearPageBorders(…)Clear page border configuration for a section.

Format

OperationAPI member pathDescription
format.applyeditor.doc.format.apply(…)Apply inline run-property patch changes to the target range with explicit set/clear semantics.
format.boldeditor.doc.format.bold(…)Set or clear the bold inline run property on the target text range.
format.italiceditor.doc.format.italic(…)Set or clear the italic inline run property on the target text range.
format.strikeeditor.doc.format.strike(…)Set or clear the strike inline run property on the target text range.
format.underlineeditor.doc.format.underline(…)Set or clear the underline inline run property on the target text range.
format.highlighteditor.doc.format.highlight(…)Set or clear the highlight inline run property on the target text range.
format.coloreditor.doc.format.color(…)Set or clear the color inline run property on the target text range.
format.fontSizeeditor.doc.format.fontSize(…)Set or clear the fontSize inline run property on the target text range.
format.fontFamilyeditor.doc.format.fontFamily(…)Set or clear the fontFamily inline run property on the target text range.
format.letterSpacingeditor.doc.format.letterSpacing(…)Set or clear the letterSpacing inline run property on the target text range.
format.vertAligneditor.doc.format.vertAlign(…)Set or clear the vertAlign inline run property on the target text range.
format.positioneditor.doc.format.position(…)Set or clear the position inline run property on the target text range.
format.dstrikeeditor.doc.format.dstrike(…)Set or clear the dstrike inline run property on the target text range.
format.smallCapseditor.doc.format.smallCaps(…)Set or clear the smallCaps inline run property on the target text range.
format.capseditor.doc.format.caps(…)Set or clear the caps inline run property on the target text range.
format.shadingeditor.doc.format.shading(…)Set or clear the shading inline run property on the target text range.
format.bordereditor.doc.format.border(…)Set or clear the border inline run property on the target text range.
format.outlineeditor.doc.format.outline(…)Set or clear the outline inline run property on the target text range.
format.shadoweditor.doc.format.shadow(…)Set or clear the shadow inline run property on the target text range.
format.embosseditor.doc.format.emboss(…)Set or clear the emboss inline run property on the target text range.
format.imprinteditor.doc.format.imprint(…)Set or clear the imprint inline run property on the target text range.
format.charScaleeditor.doc.format.charScale(…)Set or clear the charScale inline run property on the target text range.
format.kerningeditor.doc.format.kerning(…)Set or clear the kerning inline run property on the target text range.
format.vanisheditor.doc.format.vanish(…)Set or clear the vanish inline run property on the target text range.
format.webHiddeneditor.doc.format.webHidden(…)Set or clear the webHidden inline run property on the target text range.
format.specVanisheditor.doc.format.specVanish(…)Set or clear the specVanish inline run property on the target text range.
format.rtleditor.doc.format.rtl(…)Set or clear the rtl inline run property on the target text range.
format.cseditor.doc.format.cs(…)Set or clear the cs inline run property on the target text range.
format.bCseditor.doc.format.bCs(…)Set or clear the bCs inline run property on the target text range.
format.iCseditor.doc.format.iCs(…)Set or clear the iCs inline run property on the target text range.
format.eastAsianLayouteditor.doc.format.eastAsianLayout(…)Set or clear the eastAsianLayout inline run property on the target text range.
format.emeditor.doc.format.em(…)Set or clear the em inline run property on the target text range.
format.fitTexteditor.doc.format.fitText(…)Set or clear the fitText inline run property on the target text range.
format.snapToGrideditor.doc.format.snapToGrid(…)Set or clear the snapToGrid inline run property on the target text range.
format.langeditor.doc.format.lang(…)Set or clear the lang inline run property on the target text range.
format.oMatheditor.doc.format.oMath(…)Set or clear the oMath inline run property on the target text range.
format.rStyleeditor.doc.format.rStyle(…)Set or clear the rStyle inline run property on the target text range.
format.rFontseditor.doc.format.rFonts(…)Set or clear the rFonts inline run property on the target text range.
format.fontSizeCseditor.doc.format.fontSizeCs(…)Set or clear the fontSizeCs inline run property on the target text range.
format.ligatureseditor.doc.format.ligatures(…)Set or clear the ligatures inline run property on the target text range.
format.numFormeditor.doc.format.numForm(…)Set or clear the numForm inline run property on the target text range.
format.numSpacingeditor.doc.format.numSpacing(…)Set or clear the numSpacing inline run property on the target text range.
format.stylisticSetseditor.doc.format.stylisticSets(…)Set or clear the stylisticSets inline run property on the target text range.
format.contextualAlternateseditor.doc.format.contextualAlternates(…)Set or clear the contextualAlternates inline run property on the target text range.
format.strikethrougheditor.doc.format.strikethrough(…)Convenience alias for format.strike with value: true.

Styles

OperationAPI member pathDescription
styles.applyeditor.doc.styles.apply(…)Apply document-level default style changes to the stylesheet (word/styles.xml). Targets docDefaults run and paragraph channels with set-style patch semantics.

Lists

OperationAPI member pathDescription
lists.listeditor.doc.lists.list(…)List all list nodes in the document, optionally filtered by scope.
lists.geteditor.doc.lists.get(…)Retrieve a specific list node by target.
lists.inserteditor.doc.lists.insert(…)Insert a new list at the target position.
lists.createeditor.doc.lists.create(…)Create a new list from one or more paragraphs, or convert existing paragraphs into a new list.
lists.attacheditor.doc.lists.attach(…)Convert non-list paragraphs to list items under an existing list sequence.
lists.detacheditor.doc.lists.detach(…)Remove numbering properties from list items, converting them to plain paragraphs.
lists.indenteditor.doc.lists.indent(…)Increase the indentation level of a list item.
lists.outdenteditor.doc.lists.outdent(…)Decrease the indentation level of a list item.
lists.joineditor.doc.lists.join(…)Merge two adjacent list sequences into one.
lists.canJoineditor.doc.lists.canJoin(…)Check whether two adjacent list sequences can be joined.
lists.separateeditor.doc.lists.separate(…)Split a list sequence at the target item, creating a new sequence from that point forward.
lists.setLeveleditor.doc.lists.setLevel(…)Set the absolute nesting level (0..8) of a list item.
lists.setValueeditor.doc.lists.setValue(…)Set an explicit numbering value at the target item. Mid-sequence targets are atomically separated first.
lists.continuePreviouseditor.doc.lists.continuePrevious(…)Continue numbering from the nearest compatible previous list sequence.
lists.canContinuePreviouseditor.doc.lists.canContinuePrevious(…)Check whether the target sequence can continue numbering from a previous compatible sequence.
lists.setLevelRestarteditor.doc.lists.setLevelRestart(…)Set the restart behavior for a specific list level.
lists.convertToTexteditor.doc.lists.convertToText(…)Convert list items to plain paragraphs, optionally prepending the rendered marker text.

Comments

OperationAPI member pathDescription
comments.createeditor.doc.comments.create(…)Create a new comment thread (or reply when parentCommentId is given).
comments.patcheditor.doc.comments.patch(…)Patch fields on an existing comment (text, target, status, or isInternal).
comments.deleteeditor.doc.comments.delete(…)Remove a comment or reply by ID.
comments.geteditor.doc.comments.get(…)Retrieve a single comment thread by ID.
comments.listeditor.doc.comments.list(…)List all comment threads in the document.

Track Changes

OperationAPI member pathDescription
trackChanges.listeditor.doc.trackChanges.list(…)List all tracked changes in the document.
trackChanges.geteditor.doc.trackChanges.get(…)Retrieve a single tracked change by ID.
trackChanges.decideeditor.doc.trackChanges.decide(…)Accept or reject a tracked change (by ID or scope: all).

Query

OperationAPI member pathDescription
query.matcheditor.doc.query.match(…)Deterministic selector-based search with cardinality contracts for mutation targeting.

Mutations

OperationAPI member pathDescription
mutations.previeweditor.doc.mutations.preview(…)Dry-run a mutation plan, returning resolved targets without applying changes.
mutations.applyeditor.doc.mutations.apply(…)Execute a mutation plan atomically against the document.

Paragraph Formatting

OperationAPI member pathDescription
format.paragraph.resetDirectFormattingeditor.doc.format.paragraph.resetDirectFormatting(…)Strip all direct paragraph formatting while preserving style reference, numbering, and section metadata.
format.paragraph.setAlignmenteditor.doc.format.paragraph.setAlignment(…)Set paragraph alignment (justification) on a paragraph-like block.
format.paragraph.clearAlignmenteditor.doc.format.paragraph.clearAlignment(…)Remove direct paragraph alignment, reverting to style-defined or default alignment.
format.paragraph.setIndentationeditor.doc.format.paragraph.setIndentation(…)Set paragraph indentation properties (left, right, firstLine, hanging) in twips.
format.paragraph.clearIndentationeditor.doc.format.paragraph.clearIndentation(…)Remove all direct paragraph indentation.
format.paragraph.setSpacingeditor.doc.format.paragraph.setSpacing(…)Set paragraph spacing properties (before, after, line, lineRule) in twips.
format.paragraph.clearSpacingeditor.doc.format.paragraph.clearSpacing(…)Remove all direct paragraph spacing.
format.paragraph.setKeepOptionseditor.doc.format.paragraph.setKeepOptions(…)Set keep-with-next, keep-lines-together, and widow/orphan control flags.
format.paragraph.setOutlineLeveleditor.doc.format.paragraph.setOutlineLevel(…)Set the paragraph outline level (0–9) or null to clear.
format.paragraph.setFlowOptionseditor.doc.format.paragraph.setFlowOptions(…)Set contextual spacing, page-break-before, and suppress-auto-hyphens flags.
format.paragraph.setTabStopeditor.doc.format.paragraph.setTabStop(…)Add or replace a tab stop at a given position.
format.paragraph.clearTabStopeditor.doc.format.paragraph.clearTabStop(…)Remove a tab stop at a given position.
format.paragraph.clearAllTabStopseditor.doc.format.paragraph.clearAllTabStops(…)Remove all tab stops from a paragraph.
format.paragraph.setBordereditor.doc.format.paragraph.setBorder(…)Set border properties for a specific side of a paragraph.
format.paragraph.clearBordereditor.doc.format.paragraph.clearBorder(…)Remove border for a specific side or all sides of a paragraph.
format.paragraph.setShadingeditor.doc.format.paragraph.setShading(…)Set paragraph shading (background fill, pattern color, pattern type).
format.paragraph.clearShadingeditor.doc.format.paragraph.clearShading(…)Remove all paragraph shading.

Paragraph Styles

OperationAPI member pathDescription
styles.paragraph.setStyleeditor.doc.styles.paragraph.setStyle(…)Set the paragraph style reference (w:pStyle) on a paragraph-like block.
styles.paragraph.clearStyleeditor.doc.styles.paragraph.clearStyle(…)Remove the paragraph style reference from a paragraph-like block.

Tables

OperationAPI member pathDescription
tables.convertFromTexteditor.doc.tables.convertFromText(…)Convert a text range into a table.
tables.deleteeditor.doc.tables.delete(…)Delete the target table from the document.
tables.clearContentseditor.doc.tables.clearContents(…)Clear the contents of the target table or cell range.
tables.moveeditor.doc.tables.move(…)Move a table to a new position in the document.
tables.spliteditor.doc.tables.split(…)Split a table into two tables at the target row.
tables.convertToTexteditor.doc.tables.convertToText(…)Convert a table back to plain text.
tables.setLayouteditor.doc.tables.setLayout(…)Set the layout mode of the target table.
tables.insertRoweditor.doc.tables.insertRow(…)Insert a new row into the target table.
tables.deleteRoweditor.doc.tables.deleteRow(…)Delete a row from the target table.
tables.setRowHeighteditor.doc.tables.setRowHeight(…)Set the height of a table row.
tables.distributeRowseditor.doc.tables.distributeRows(…)Distribute row heights evenly across the target table.
tables.setRowOptionseditor.doc.tables.setRowOptions(…)Set options on a table row such as header repeat or page break.
tables.insertColumneditor.doc.tables.insertColumn(…)Insert a new column into the target table.
tables.deleteColumneditor.doc.tables.deleteColumn(…)Delete a column from the target table.
tables.setColumnWidtheditor.doc.tables.setColumnWidth(…)Set the width of a table column.
tables.distributeColumnseditor.doc.tables.distributeColumns(…)Distribute column widths evenly across the target table.
tables.insertCelleditor.doc.tables.insertCell(…)Insert a new cell into a table row.
tables.deleteCelleditor.doc.tables.deleteCell(…)Delete a cell from a table row.
tables.mergeCellseditor.doc.tables.mergeCells(…)Merge a range of table cells into one.
tables.unmergeCellseditor.doc.tables.unmergeCells(…)Unmerge a previously merged table cell.
tables.splitCelleditor.doc.tables.splitCell(…)Split a table cell into multiple cells.
tables.setCellPropertieseditor.doc.tables.setCellProperties(…)Set properties on a table cell such as vertical alignment or text direction.
tables.sorteditor.doc.tables.sort(…)Sort table rows by a column value.
tables.setAltTexteditor.doc.tables.setAltText(…)Set the alternative text description for a table.
tables.setStyleeditor.doc.tables.setStyle(…)Apply a named table style to the target table.
tables.clearStyleeditor.doc.tables.clearStyle(…)Remove the applied table style, reverting to defaults.
tables.setStyleOptioneditor.doc.tables.setStyleOption(…)Toggle a conditional style option such as banded rows or first column.
tables.setBordereditor.doc.tables.setBorder(…)Set border properties on a table or cell range.
tables.clearBordereditor.doc.tables.clearBorder(…)Remove border formatting from a table or cell range.
tables.applyBorderPreseteditor.doc.tables.applyBorderPreset(…)Apply a border preset (e.g. all borders, outside only) to a table.
tables.setShadingeditor.doc.tables.setShading(…)Set the background shading color on a table or cell range.
tables.clearShadingeditor.doc.tables.clearShading(…)Remove shading from a table or cell range.
tables.setTablePaddingeditor.doc.tables.setTablePadding(…)Set default cell padding for the entire table.
tables.setCellPaddingeditor.doc.tables.setCellPadding(…)Set padding on a specific table cell or cell range.
tables.setCellSpacingeditor.doc.tables.setCellSpacing(…)Set the cell spacing for the target table.
tables.clearCellSpacingeditor.doc.tables.clearCellSpacing(…)Remove custom cell spacing from the target table.
tables.geteditor.doc.tables.get(…)Retrieve table structure and dimensions by locator.
tables.getCellseditor.doc.tables.getCells(…)Retrieve cell information for a table, optionally filtered by row or column.
tables.getPropertieseditor.doc.tables.getProperties(…)Retrieve layout and style properties of a table.
tables.getStyleseditor.doc.tables.getStyles(…)List all table styles and the document-level default table style setting.
tables.setDefaultStyleeditor.doc.tables.setDefaultStyle(…)Set the document-level default table style (w:defaultTableStyle in settings.xml).
tables.clearDefaultStyleeditor.doc.tables.clearDefaultStyle(…)Remove the document-level default table style setting.

History

OperationAPI member pathDescription
history.geteditor.doc.history.get(…)Query the current undo/redo history state of the active editor.
history.undoeditor.doc.history.undo(…)Undo the most recent history-safe mutation in the active editor.
history.redoeditor.doc.history.redo(…)Redo the most recently undone action in the active editor.

Table of Contents

OperationAPI member pathDescription
toc.listeditor.doc.toc.list(…)List all tables of contents in the document.
toc.geteditor.doc.toc.get(…)Retrieve details of a specific table of contents.
toc.configureeditor.doc.toc.configure(…)Update the configuration switches of a table of contents.
toc.updateeditor.doc.toc.update(…)Rebuild or refresh the materialized content of a table of contents.
toc.removeeditor.doc.toc.remove(…)Remove a table of contents from the document.
toc.markEntryeditor.doc.toc.markEntry(…)Insert a TC (table of contents entry) field at the target paragraph.
toc.unmarkEntryeditor.doc.toc.unmarkEntry(…)Remove a TC (table of contents entry) field from the document.
toc.listEntrieseditor.doc.toc.listEntries(…)List all TC (table of contents entry) fields in the document body.
toc.getEntryeditor.doc.toc.getEntry(…)Retrieve details of a specific TC (table of contents entry) field.
toc.editEntryeditor.doc.toc.editEntry(…)Update the properties of a TC (table of contents entry) field.

Images

OperationAPI member pathDescription
images.listeditor.doc.images.list(…)List all images in the document.
images.geteditor.doc.images.get(…)Get details for a specific image by its stable ID.
images.deleteeditor.doc.images.delete(…)Delete an image from the document.
images.moveeditor.doc.images.move(…)Move an image to a new location in the document.
images.convertToInlineeditor.doc.images.convertToInline(…)Convert a floating image to inline placement.
images.convertToFloatingeditor.doc.images.convertToFloating(…)Convert an inline image to floating placement.
images.setSizeeditor.doc.images.setSize(…)Set explicit width/height for an image.
images.setWrapTypeeditor.doc.images.setWrapType(…)Set the text wrapping type for a floating image.
images.setWrapSideeditor.doc.images.setWrapSide(…)Set which side(s) text wraps around a floating image.
images.setWrapDistanceseditor.doc.images.setWrapDistances(…)Set the text-wrap distance margins for a floating image.
images.setPositioneditor.doc.images.setPosition(…)Set the anchor position for a floating image.
images.setAnchorOptionseditor.doc.images.setAnchorOptions(…)Set anchor behavior options for a floating image.
images.setZOrdereditor.doc.images.setZOrder(…)Set the z-order (relativeHeight) for a floating image.