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

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

Type-Specific Parameters

Depending on the block type, you can update type-specific properties:
paragraph
object
For paragraph blocks:
  • rich_text - Array of rich text objects
  • color - Text color (e.g., "blue", "red_background")
heading_1
object
For heading 1 blocks:
  • rich_text - Array of rich text objects
  • color - Text color
  • is_toggleable - Whether the heading can be toggled
heading_2
object
For heading 2 blocks (same as heading_1)
heading_3
object
For heading 3 blocks (same as heading_1)
code
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
to_do
object
For to-do blocks:
  • rich_text - Array of rich text objects
  • checked - Boolean indicating if the item is checked
  • color - Text color
callout
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.
object
string
Always "block"
id
string
The block ID
type
string
The block type
last_edited_time
string
Updated timestamp reflecting the modification
last_edited_by
PartialUserObjectResponse
User who made the update
archived
boolean
Current archived status
in_trash
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: