Skip to content

How to use client.blocks.update? #183

Answered by ramnes
j-chan-hkust asked this question in Q&A
Discussion options

You must be logged in to vote

When in doubt, refer to Notion's documentation and try to do the same with the Python client: https://developers.notion.com/reference/update-a-block

Notion gives this JS example:

const response = await notion.blocks.update({
  "block_id": blockId,
  "heading_2": {
    "rich_text": [
      {
        "text": {
          "content": "Lacinato kale"
        },
        "annotations": {
          "color": "green"
        }
      }
    ]
  }
});

So this should work in Python:

response = await notion.blocks.update(**{
    "block_id": block_id,
    "heading_2": {
        "rich_text": [
            {
                "text": {
                    "content": "Lacinato kale"
                },
        …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by j-chan-hkust
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #182 on March 21, 2023 09:30.