# Core operations

> Primary read and write operations.



17 operations. Names, descriptions, and behavior flags come from the canonical contract.

## Operations

- [`get`](/document-api/reference/get) (read): Read the full document as an SDDocument structure.
- [`find`](/document-api/reference/find) (read): Search the document for text or node matches using SDM/1 selectors. Returns discovery-grade results: for mutation targeting, use query.match instead.
- [`getNode`](/document-api/reference/get-node) (read): Retrieve a single node by target position.
- [`getNodeById`](/document-api/reference/get-node-by-id) (read): Retrieve a single node by its unique ID.
- [`getText`](/document-api/reference/get-text) (read): Extract the plain-text content of the document.
- [`getMarkdown`](/document-api/reference/get-markdown) (read): Extract the document content as a Markdown string.
- [`getHtml`](/document-api/reference/get-html) (read): Extract the document content as an HTML string.
- [`projectMarkdown`](/document-api/reference/project-markdown) (read): Project document content as Markdown with review, scope, diagnostics, and provenance metadata.
- [`projectHtml`](/document-api/reference/project-html) (read): Project document content as HTML with review, scope, diagnostics, and provenance metadata.
- [`markdownToFragment`](/document-api/reference/markdown-to-fragment) (read): Convert a Markdown string into an SDM/1 structural fragment.
- [`htmlToFragment`](/document-api/reference/html-to-fragment) (read): Convert an HTML string into an SDM/1 structural fragment.
- [`info`](/document-api/reference/info) (read): Return document summary info including word, character, paragraph, heading, table, image, comment, tracked-change, SDT-field, list, and page counts, plus outline and capabilities.
- [`extract`](/document-api/reference/extract) (read): Extract all document content with stable IDs for RAG pipelines. Returns blocks with full text, comments, and tracked changes: each with an ID compatible with scrollToElement().
- [`clearContent`](/document-api/reference/clear-content) (mutates): Clear all document body content, leaving a single empty paragraph.
- [`insert`](/document-api/reference/insert) (mutates, tracked): Insert content into the document. Two input shapes: text-based (value + type) inserts inline content at a SelectionTarget or ref position within an existing block; structural SDFragment (content) inserts one or more blocks as siblings relative to a BlockNodeAddress target. When target/ref is omitted, content appends at the end of the document. Text mode supports text (default), markdown, and html content types via the `type` field. Rich markdown/html and structural modes use `placement` (before/after/insideStart/insideEnd) to position relative to a block target.
- [`replace`](/document-api/reference/replace) (mutates, tracked): Replace content at a contiguous document selection. Text path accepts a SelectionTarget or ref plus replacement text. Rich string path accepts HTML or Markdown plus a BlockNodeAddress, SelectionTarget, or ref. Structural path accepts the same locator forms plus SDFragment content. An explicit {kind:'story', storyType:'body'} target replaces the complete main body in direct mode while preserving the destination DOCX package.
- [`delete`](/document-api/reference/delete) (mutates, tracked): Delete content at a contiguous document selection. Accepts a SelectionTarget or mutation-ready ref. Supports cross-block deletion and optional block-edge expansion via behavior mode.

