Setu Recipes: reusable workflows across every app.Browse templates
Setuसेतु

Integrations / Notion

Notion

Workspace docs and databases: pages, blocks and queries.

6 actions OAuth 2 3 read3 write Calls api.notion.com

Connect

TypeScript
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

ScopeWhy it is requested
contentRead 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

InputTypeDescription
block_idstringRequiredPage or block ID
childrenarray of anyRequiredNotion block objects
TypeScript
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

InputTypeDescription
parentobjectRequiredParent, e.g. {database_id: ...} or {page_id: ...}
propertiesobjectRequiredPage properties
childrenarray of anyOptional
TypeScript
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

InputTypeDescription
page_idstringRequired
TypeScript
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

InputTypeDescription
database_idstringRequired
filterobjectOptional
page_sizeintegerOptional
TypeScript
await setu.execute({
  userId: "user_1",
  action: "notion.query_database",
  input: {
    "database_id": "<database_id>"
  },
});
Update pagewritenotion.update_pageUpdate properties of a page or archive it.

Needs scope: content

InputTypeDescription
page_idstringRequired
propertiesobjectOptional
archivedbooleanOptional
TypeScript
await setu.execute({
  userId: "user_1",
  action: "notion.update_page",
  input: {
    "page_id": "<page_id>"
  },
});