Notion
ToolJet can connect to a Notion workspace to do operations on notion pages, databases, users and blocks.
Connection
To establish a connection with the Notion data source, click on the + Add new Data source button located on the query panel or navigate to the Data Sources page from the ToolJet dashboard.
For integrating Notion with ToolJet we will need the API token. The API token can be generated from your Notion workspace settings. Read the official Notion docs for Creating an internal integration with notion API.

Querying Notion
Notion API provides support for:

Database ID, View ID and Page ID can be found using notion workspace URL.
For example:
URL: https://www.notion.so/workspace/XXX?v=YYY&p=ZZZ
Here:
XXXis the Database IDYYYis the View IDZZZis the Page ID
Before querying Notion, you must share the database with your integration. Click the share button in your database view, find your integration name select it.

Querying Notion Database
On database resource you can perform the following operations:

Retrieve a Database
This operations retrieves a Database object using the ID specified.
Required Parameters:
- Database ID

Query a Database
This operation gets a list of Pages contained in the database, filtered and ordered according to the filter conditions and sort criteria provided in the query.
Required Parameters:
- Database ID
Optional Parameters:
- Filter
- Sort
- Limit
- Start Cursor

Create a Database
This operation creates a database as a subpage in the specified parent page, with the specified properties.
Required Parameters:
- Database ID
- Page ID
- Properties
Optional Parameters:
- Title
- Icon type
- Icon value
- Cover type
- Cover value

Example:
Title
[
{
"type": "text",
"text": {
"content": "Project Tasks Database",
"link": null
}
}
]
Properties
{
"Task Name": {
"title": {}
},
"Due Date": {
"date": {}
},
"Completed": {
"checkbox": {}
}
}
Update a Database
This operation updates an existing database as specified by the parameters.
Required Parameters:
- Database ID
Optional Parameters:
- Title
- Properties
- Icon type
- Icon value
- Cover type
- Cover value

Example:
Title
[
{
"type": "text",
"text": {
"content": "Updated Tasks Database"
}
}
]
Properties
{
"Priority": {
"select": {
"options": [
{ "name": "High", "color": "red" },
{ "name": "Medium", "color": "yellow" },
{ "name": "Low", "color": "green" }
]
}
},
"Assigned To": {
"people": {}
}
}
Querying Notion Page
On page resource you can perform the following operations:

Retrieve a Page
This operation retrieves a Page object using the ID specified.
Required Parameters:
- Page ID

Create a Page
This operation creates a new page in the specified database or as a child of an existing page. If the parent is a database, the property values of the new page in the properties parameter must conform to the parent database's property schema. If the parent is a page, the only valid property is title.
Required Parameters:
- Parent Type
- Page/Database ID
- Properties
Optional Parameters:
- Children (Blocks)
- Icon type
- Icon value
- Cover type
- Cover value

Example:
{
"Title": {
"title": [
{
"type": "text",
"text": {
"content": "New Page Title"
}
}
]
}
}
Update a Page
This operation updates page property values for the specified page. Properties that are not set via the properties parameter will remain unchanged.
Required Parameters:
- Page ID
- Properties
Optional Parameters
- Icon type
- Icon value
- Cover type
- Cover value

Example:
{
"Title": {
"title": [
{
"type": "text",
"text": {
"content": "Updated Page Title"
}
}
]
},
"Status": {
"select": {
"name": "In Progress"
}
}
}