ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
Notion -> Block: Update
Readonly
How to Get a Notion API Key

Action summary

Notion -> Block: Update

Xano / Notion

How to Get a Notion API Key

  1. Create an Integration

    • Go to the Notion Developers Portal.
    • Click "New Integration", name it, select a workspace, and submit.
  2. Get Your API Key

    • Copy the Internal Integration Token from the integration settings page.
  3. Grant Database Access

    • Open your Notion database.
    • Click the three button dropdown at the top right of your screen, click Connections, and then select your integration.
  4. Use the API Key

    • Add it to your Xano Actions in the Settings Registry input option:

For more details, see the Notion API Docs.

Notion → Block: Update

Overview

This Xano action updates a block in Notion using its unique identifier (block_id). It uses the Notion API's PATCH method to modify the block's content.


Inputs

Name Type Description
notion_api_key registry text
block_id text The unique identifier of the block to update
body json The update payload containing block changes

Function Stack

  1. Notion API Request

    • API Endpoint: https://api.notion.com/v1/blocks/%s
    • HTTP Method: PATCH
    • Headers:
      • Authorization: Bearer <notion_api_key>
      • Content-Type: application/json
      • Notion-Version: 2022-06-28
    • Replace %s in the endpoint with the provided block_id
  2. Precondition

    • Ensures that the HTTP request was successful
    • Condition: notion_api_response.status == 200
      • If this condition fails, execution halts and an error is thrown

Response

Key Value
As Self Returns notion_api_response.result

Example

Input

{
    "block_id": "1234",
    "body": {
        "paragraph": {
            "rich_text": [
                {
                    "text": {
                        "content": "Updated paragraph text"
                    }
                }
            ]
        }
    }
}

Output

{
  "object": "block",
  "id": "7985540b-2e77-4ac6-8615-c3047e36f872",
  "parent": {
    "type": "page_id",
    "page_id": "59833787-2cf9-4fdf-8782-e53db20768a5"
  },
  "created_time": "2022-07-06T19:52:00.000Z",
  "last_edited_time": "2022-07-06T19:52:00.000Z",
  "created_by": {
    "object": "user",
    "id": "0c3e9826-b8f7-4f73-927d-2caaf86f1103"
  },
  "last_edited_by": {
    "object": "user",
    "id": "ee5f0f84-409a-440f-983a-a5315961c6e4"
  },
  "has_children": false,
  "archived": false,
  "type": "paragraph",
  "paragraph": {
    "rich_text": [
      {
        "type": "text",
        "text": {
          "content": "Updated paragraph text",
          "link": null
        },
        "annotations": {
          "bold": false,
          "italic": false,
          "strikethrough": false,
          "underline": false,
          "code": false,
          "color": "default"
        },
        "plain_text": "Updated paragraph text",
        "href": null
      }
    ],
    "color": "default"
  }
}

Version notes

2025-01-20 16:07:40
Current
2025-04-15T22:44:44.000+00:00