find_replace_in_block
Find and replace text within a Notion block while preserving all formatting. If the text is not found, receive an error with the block's current plain text to diagnose mismatches.
Instructions
Find and replace text within a block, preserving all formatting.
Replaces occurrences of old_text with new_text in each rich text segment while keeping bold, italic, links, and other annotations intact.
Returns an error (not a silent no-op) if old_text does not appear in the block. The error message includes the block's current plain text so the caller can diagnose Unicode / whitespace / formatting mismatches (e.g., en-dash U+2013 vs hyphen-minus U+002D, curly vs straight quotes, non-breaking space U+00A0 vs regular space). Use update_block_text or update_table_cell for full-text replacement when find/replace doesn't match because of character mismatches.
The success response includes a replacements field with the total
number of occurrences of old_text that were replaced.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| block_id | Yes | ||
| old_text | Yes | ||
| new_text | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |