> ## Documentation Index
> Fetch the complete documentation index at: https://developers.myhero.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Patch document

> Surgically edit a document by applying block-level operations. Each operation targets a specific block by its blockId (use list_document_blocks to find…

`patch_document`

Surgically edit a document by applying block-level operations. Each operation targets a specific block by its blockId (use list\_document\_blocks to find IDs first). Operations: replace, insertBefore, insertAfter, delete. Applied in order; partial success possible. Markdown field uses the same extended syntax as write\_document\_markdown — see system prompt.

## Parameters

<ParamField path="documentId" type="string" required>
  ID of the document to patch.
</ParamField>

<ParamField path="operations" type="array<object>" required>
  Array of patch operations to apply in order.
</ParamField>
