Notion -> Block: Retrieve Children
Readonly
Action summary
How to Get a Notion API Key
Create an Integration
- Go to the Notion Developers Portal.
- Click "New Integration", name it, select a workspace, and submit.
Get Your API Key
- Copy the Internal Integration Token from the integration settings page.
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.
Use the API Key
- Add it to your Xano Actions in the
Settings Registryinput option:
- Add it to your Xano Actions in the
For more details, see the Notion API Docs.
Notion → Block: Retrieve Children
Overview
This Xano action retrieves all child blocks contained within a specified block in Notion. It uses the Notion API's GET method to fetch the children of a block.
Inputs
| Name | Type | Description |
|---|---|---|
notion_api_key |
registry | text |
block_id |
text | The unique identifier of the parent block |
start_cursor |
text | Cursor for pagination (optional) |
page_size |
integer | Size of page to return per request |
Function Stack
Notion API Request
- API Endpoint:
https://api.notion.com/v1/blocks/%s/children - HTTP Method: GET
- Headers:
- Authorization: Bearer
<notion_api_key> - Notion-Version: 2022-06-28
- Authorization: Bearer
- Replace
%sin the endpoint with the providedblock_id
- API Endpoint:
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 |
API Reference Example
Request
Example
Input
{
"block_id": "9bc30ad4-9373-46a5-84ab-0a7845ee52e6",
"start_cursor": "",
"page_size": 0
}
Output
{
"object": "list",
"results": [
{
"object": "block",
"id": "9bc30ad4-9373-46a5-84ab-0a7845ee52e6",
"parent": {
"type": "page_id",
"page_id": "59833787-2cf9-4fdf-8782-e53db20768a5"
},
"created_time": "2022-07-08T12:43:00.000Z",
"last_edited_time": "2022-07-08T12:43:00.000Z",
"created_by": {
"object": "user",
"id": "ee5f0f84-409a-440f-983a-a5315961c6e4"
},
"last_edited_by": {
"object": "user",
"id": "ee5f0f84-409a-440f-983a-a5315961c6e4"
},
"has_children": false,
"archived": false,
"type": "paragraph",
"paragraph": {
"rich_text": [],
"color": "default"
}
}
],
"next_cursor": "AWpj5x3qVEzV4",
"has_more": true
}
Version notes
2025-01-27 18:49:29
Current