replace_content
Replace a Notion page's entire content in one atomic API call, preserving block anchors and inline comments, with warnings for unmatched blocks.
Instructions
Replaces all page content with the provided markdown atomically (one Notion API call). Notion's atomic markdown endpoint converts the markdown to native Notion blocks in that one API call. On matched blocks Notion preserves the original block IDs, so deep-link anchors (#block-id) and inline-comment threads attached to those blocks survive the edit. Unmatched blocks (returned in warnings with code unmatched_blocks) are replaced with new IDs.
NOT preserved across replace_content: child_page subpages, synced_block instances, child_database views, and link_to_page references on the source page. Enhanced Markdown has no input form for these, so they are dropped from the new page content. If the source contains them, use duplicate_page first or edit those types via the Notion UI. For an inline page mention, use @Title; that is a separate construct from the link_to_page block type.
Bookmarks and embeds are written as bare URLs (Notion auto-links) and surface a bookmark_lost_on_atomic_replace or embed_lost_on_atomic_replace warning so callers know the rich preview is lost. For supported markdown syntax and warning details, read resources easy-notion://docs/markdown and easy-notion://docs/warnings. Returns: { success: true }, optionally truncated: true, optionally warnings with entries such as { code: "unmatched_blocks", block_ids: [...] }, plus block_map for the resulting top-level blocks when present. A dry run returns { success: true, dry_run: true, operation, page_id, would_update: true } and optionally warnings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Preview validation and planned effect without mutating Notion. Default false. | |
| page_id | Yes | Page ID | |
| markdown | Yes | Replacement markdown content | |
| return_block_map | No | Include block_map in the response. Default true. Set false to skip the per-block id list when you do not plan to edit individual blocks. | |
| collapse_soft_wraps | No | Collapse single line breaks to spaces per CommonMark before writing. Default false (single line breaks are kept as they are today). Recommended when uploading hard-wrapped prose files (e.g. repo markdown wrapped at 78 columns). Do not use when re-uploading content read from Notion, or intentional line breaks will be lost. Blank lines and code blocks are unaffected. Note: replace_content renders an in-paragraph line break as a separate paragraph regardless of this option. |