Integrations / Notion
Notion
Workspace docs and databases: pages, blocks and queries.
6 actions
OAuth 2
3 read3 write
Calls api.notion.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "notion" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
| Scope | Why it is requested |
|---|---|
content | Read and write the pages and databases you share with Setu |
Actions
Append blockswritenotion.append_blocksAppend content blocks to a page or block.
Needs scope: content
| Input | Type | Description | |
|---|---|---|---|
block_id | string | Required | Page or block ID |
children | array of any | Required | Notion block objects |
await setu.execute({
userId: "user_1",
action: "notion.append_blocks",
input: {
"block_id": "<block_id>",
"children": []
},
});Create pagewritenotion.create_pageCreate a page under a parent page or database.
Needs scope: content
| Input | Type | Description | |
|---|---|---|---|
parent | object | Required | Parent, e.g. {database_id: ...} or {page_id: ...} |
properties | object | Required | Page properties |
children | array of any | Optional |
await setu.execute({
userId: "user_1",
action: "notion.create_page",
input: {
"parent": {},
"properties": {}
},
});Get pagereadnotion.get_pageRetrieve a page and its properties.
Needs scope: content
| Input | Type | Description | |
|---|---|---|---|
page_id | string | Required |
await setu.execute({
userId: "user_1",
action: "notion.get_page",
input: {
"page_id": "<page_id>"
},
});Query databasereadnotion.query_databaseQuery rows of a database with an optional filter.
Needs scope: content
| Input | Type | Description | |
|---|---|---|---|
database_id | string | Required | |
filter | object | Optional | |
page_size | integer | Optional |
await setu.execute({
userId: "user_1",
action: "notion.query_database",
input: {
"database_id": "<database_id>"
},
});Searchreadnotion.searchSearch pages and databases shared with the integration.
Needs scope: content
| Input | Type | Description | |
|---|---|---|---|
query | string | Optional | |
page_size | integer | Optional |
await setu.execute({
userId: "user_1",
action: "notion.search",
input: {},
});Update pagewritenotion.update_pageUpdate properties of a page or archive it.
Needs scope: content
| Input | Type | Description | |
|---|---|---|---|
page_id | string | Required | |
properties | object | Optional | |
archived | boolean | Optional |
await setu.execute({
userId: "user_1",
action: "notion.update_page",
input: {
"page_id": "<page_id>"
},
});