Update Block

Updates the content of a block

Usage #

// Import the typed helper
import { updateBlock } from "@hotglue/sdk/notion";
const result = await client.execute({
...updateBlock({
block_id: string,
paragraph: object,
heading_1: object,
// ...
}),
userId: "user_123",
});
// result is typed as UpdateBlockOutput
const result = await client.execute({
integration: "notion",
tool: "update_block",
userId: "user_123",
input: {
block_id: string,
paragraph: object,
heading_1: object,
// ...
},
});
// The agent will automatically use this tool when needed
const agent = new Agent({
tools: () => hotglueTools({
integrations: ["notion"],
userId: "user_123",
}),
});
await agent.generate("run the Update Block tool");

Required Permissions #

update_content

Input Schema #

block_id string required

The ID of the block to update

paragraph object

Paragraph block content (use if block type is paragraph)

heading_1 object

Heading 1 block content

heading_2 object

Heading 2 block content

heading_3 object

Heading 3 block content

bulleted_list_item object

Bulleted list item content

numbered_list_item object

Numbered list item content

to_do object

To-do block content

toggle object

Toggle block content

code object

Code block content

archived bool

Set to true to archive the block

This tool calls: #

PATCH https://api.notion.com/v1/blocks/{block_id}