Skip to main content
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.

Method Signature

Source: Client.ts:597-608

Parameters

string
required
The ID of the block to update
string
The type of block (e.g., "paragraph", "heading_1", "code", etc.). Must match the type-specific content being updated.
boolean
Set to true to archive the block, or false to unarchive it
boolean
Set to true to move the block to trash, or false to restore it
string
Optional authentication token to override the client-level auth

Type-Specific Parameters

Depending on the block type, you can update type-specific properties:
object
For paragraph blocks:
  • rich_text - Array of rich text objects
  • color - Text color (e.g., "blue", "red_background")
object
For heading 1 blocks:
  • rich_text - Array of rich text objects
  • color - Text color
  • is_toggleable - Whether the heading can be toggled
object
For heading 2 blocks (same as heading_1)
object
For heading 3 blocks (same as heading_1)
object
For code blocks:
  • rich_text - Array of rich text objects containing the code
  • language - Programming language (e.g., "javascript", "python")
  • caption - Array of rich text objects for the caption
object
For to-do blocks:
  • rich_text - Array of rich text objects
  • checked - Boolean indicating if the item is checked
  • color - Text color
object
For callout blocks:
  • rich_text - Array of rich text objects
  • icon - Icon object (emoji or file)
  • color - Background color

Response

Returns the updated BlockObjectResponse or PartialBlockObjectResponse.
string
Always "block"
string
The block ID
string
The block type
string
Updated timestamp reflecting the modification
PartialUserObjectResponse
User who made the update
boolean
Current archived status
boolean
Current trash status

Examples

Update Paragraph Text

Update Code Block Language

Toggle a To-Do Item

Archive a Block

Restore from Trash

Update Callout with Icon

Limitations

Not all block types support all updates. Some restrictions:
  • Child pages and child databases cannot have their content updated
  • Table blocks cannot be updated after creation
  • Some read-only blocks (like breadcrumbs) have limited update capabilities
  • You cannot change a block’s type - create a new block instead

Error Handling

Type Safety

The SDK provides full TypeScript support for block updates: