Notion -> Database: Update
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 → Database: Update
Overview
This Xano action updates a database in Notion using its unique identifier (database_id). It uses the Notion API's PATCH method to modify database content.
Inputs
| Name | Type | Description |
|---|---|---|
notion_api_key |
registry | text |
database_id |
text | The unique identifier of the database |
body_params |
json | The parameters to update in the database |
Function Stack
Notion API Request
- API Endpoint:
https://api.notion.com/v1/databases/%s - HTTP Method: PATCH
- Headers:
- Authorization: Bearer
<notion_api_key> - Notion-Version: 2022-06-28
- Authorization: Bearer
- Replace
%sin the endpoint with the provideddatabase_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 |
Example
Input
{
"database_id": "d2478ac4cbf34e079ff045297c33ca3e",
"body_params": {
"title": [
{
"text": {
"content": "Tomorrows grocery list"
}
}
]
}
}
Output
{
"object": "database",
"id": "bc1211ca-e3f1-4939-ae34-5260b16f627c",
"created_time": "2021-07-08T23:50:00.000Z",
"last_edited_time": "2021-07-08T23:50:00.000Z",
"icon": {
"type": "emoji",
"emoji": "🎉"
},
"cover": {
"type": "external",
"external": {
"url": "https://website.domain/images/image.png"
}
},
.
.
.
{
.
.
.
"Name": {
"id": "title",
"name": "Name",
"type": "title",
"title": {}
}
},
"parent": {
"type": "page_id",
"page_id": "98ad959b-2b6a-4774-80ee-00246fb0ea9b"
},
"archived": false,
"is_inline": false
}
Version notes
Initial version
Current