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
Core808Open
Capabilities101Open
Create202Open
Format549Open
Lists808Open
Comments505Open
Track Changes303Open
Query101Open
Mutations202Open

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.
infoeditor.doc.info(…)Return document metadata including revision, node count, and capabilities.
inserteditor.doc.insert(…)Insert text or inline content at a target position.
replaceeditor.doc.replace(…)Replace content at a target position with new text or inline content.
deleteeditor.doc.delete(…)Delete content at a target position.

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.

Format

OperationAPI member pathDescription
format.applyeditor.doc.format.apply(…)Apply explicit inline style changes (bold, italic, underline, strike) to the target range using boolean patch semantics.
format.fontSizeeditor.doc.format.fontSize(…)Set or unset the font size on the target text range. Pass null to remove.
format.fontFamilyeditor.doc.format.fontFamily(…)Set or unset the font family on the target text range. Pass null to remove.
format.coloreditor.doc.format.color(…)Set or unset the text color on the target text range. Pass null to remove.
format.aligneditor.doc.format.align(…)Set or unset paragraph alignment on the block containing the target. Pass null to reset to default.
format.boldeditor.doc.format.bold(…)Convenience alias for format.apply with inline.bold: true.
format.italiceditor.doc.format.italic(…)Convenience alias for format.apply with inline.italic: true.
format.underlineeditor.doc.format.underline(…)Convenience alias for format.apply with inline.underline: true.
format.strikethrougheditor.doc.format.strikethrough(…)Convenience alias for format.apply with inline.strike: true.

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.setTypeeditor.doc.lists.setType(…)Change the list type (ordered, unordered) of a target list.
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.restarteditor.doc.lists.restart(…)Restart numbering of an ordered list at the target item.
lists.exiteditor.doc.lists.exit(…)Exit a list context, converting the target item to a paragraph.

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.