Updates a block object by modifying its type-specific content, archival status, or trash status. Not all block types can be updated, and only certain properties are mutable.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/makenotion/notion-sdk-js/llms.txt
Use this file to discover all available pages before exploring further.
Method Signature
Parameters
The ID of the block to update
The type of block (e.g.,
"paragraph", "heading_1", "code", etc.). Must match the type-specific content being updated.Set to
true to archive the block, or false to unarchive itSet to
true to move the block to trash, or false to restore itOptional authentication token to override the client-level auth
Type-Specific Parameters
Depending on the block type, you can update type-specific properties:For paragraph blocks:
rich_text- Array of rich text objectscolor- Text color (e.g.,"blue","red_background")
For heading 1 blocks:
rich_text- Array of rich text objectscolor- Text coloris_toggleable- Whether the heading can be toggled
For heading 2 blocks (same as heading_1)
For heading 3 blocks (same as heading_1)
For code blocks:
rich_text- Array of rich text objects containing the codelanguage- Programming language (e.g.,"javascript","python")caption- Array of rich text objects for the caption
For to-do blocks:
rich_text- Array of rich text objectschecked- Boolean indicating if the item is checkedcolor- Text color
For callout blocks:
rich_text- Array of rich text objectsicon- Icon object (emoji or file)color- Background color
Response
Returns the updatedBlockObjectResponse or PartialBlockObjectResponse.
Always
"block"The block ID
The block type
Updated timestamp reflecting the modification
User who made the update
Current archived status
Current trash status