Skip to content
Talk to an Engineer Dashboard

Notion

Connect to Notion workspace. Create, edit pages, manage databases, and collaborate on content

Connect to Notion workspace. Create, edit pages, manage databases, and collaborate on content

Notion logo

Supports authentication: OAuth 2.0

Register your Scalekit environment with the Notion connector so Scalekit handles the authentication flow and token lifecycle for you. The connection name you create will be used to identify and invoke the connection programmatically. Then complete the configuration in your application as follows:

  1. Set up auth redirects

    • In Scalekit dashboard, go to Agent AuthCreate Connection. Find Notion and click Create. Copy the redirect URI. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

      Copy redirect URI from Scalekit dashboard

    • Go to Notion Integrations and click New integration.

    • Fill in the integration name and select your workspace. In the OAuth Domain & URIs section, paste the redirect URI from Scalekit and click Submit.

      Add redirect URI in Notion integration settings

  2. Get client credentials

    • In your Notion integration settings, go to the Secrets tab.

    • Copy the OAuth client ID and OAuth client secret.

  3. Add credentials in Scalekit

    • In Scalekit dashboard, go to Agent AuthConnections and open the connection you created.

    • Enter your credentials:

      • Client ID (OAuth client ID from above)
      • Client Secret (OAuth client secret from above)
      • Permissions (capabilities — see Notion capabilities reference)

      Add credentials in Scalekit dashboard

    • Click Save.

Connect a user’s Notion account and make API calls on their behalf — Scalekit handles OAuth and token management automatically.

You can interact with Notion in two ways — via direct proxy API calls or via Scalekit optimized tool calls. Scroll down to see the list of available Scalekit tools.

Proxy API Calls

import { ScalekitClient } from '@scalekit-sdk/node';
import 'dotenv/config';
const connectionName = 'notion'; // get your connection name from connection configurations
const identifier = 'user_123'; // your unique user identifier
// Get your credentials from app.scalekit.com → Developers → Settings → API Credentials
const scalekit = new ScalekitClient(
process.env.SCALEKIT_ENV_URL,
process.env.SCALEKIT_CLIENT_ID,
process.env.SCALEKIT_CLIENT_SECRET
);
const actions = scalekit.actions;
// Authenticate the user
const { link } = await actions.getAuthorizationLink({
connectionName,
identifier,
});
console.log('🔗 Authorize Notion:', link);
process.stdout.write('Press Enter after authorizing...');
await new Promise(r => process.stdin.once('data', r));
// Make a request via Scalekit proxy
const result = await actions.request({
connectionName,
identifier,
path: '/v1/users/me',
method: 'GET',
});
console.log(result);

Scalekit Tools

Delete (archive) a Notion block by its ID. This also deletes all child blocks within it.

NameTypeRequiredDescription
block_idstringYesThe ID of the block to delete

Update the text content of an existing Notion block. Supports paragraph, heading, list item, quote, callout, and code blocks.

NameTypeRequiredDescription
block_idstringYesThe ID of the block to update
languagestringNoProgramming language for code blocks
textstringYesNew text content for the block
typestringYesThe block type (must match the existing block type)

Create a comment in Notion. Provide a comment object with rich_text content and either a parent object (with page_id) for a page-level comment or a discussion_id to reply in an existing thread.

NameTypeRequiredDescription
commentobjectYesComment object containing a rich_text array. Example: {"rich_text":[{"type":"text","text":{"content":"Hello"}}]}
discussion_idstringNoExisting discussion thread ID to reply to.
notion_versionstringNoOptional override for the Notion-Version header (e.g., 2022-06-28).
parentobjectNoParent object for a new top-level comment. Shape: {"page_id":"<uuid>"}.
schema_versionstringNoInternal override for schema version.
tool_versionstringNoInternal override for tool implementation version.

Retrieve a single Notion comment by its comment_id. LLM tip: you typically obtain comment_id from the response of creating a comment or by first listing comments for a page/block and selecting the desired item’s id.

NameTypeRequiredDescription
comment_idstringYesThe identifier of the comment to retrieve (hyphenated UUID). Obtain it from Create-Comment responses or from a prior List-Comments call.
notion_versionstringNoOptional Notion-Version header override (e.g., 2022-06-28).
schema_versionstringNoInternal override for schema version.
tool_versionstringNoInternal override for tool implementation version.

Fetch comments for a given Notion block. Provide a block_id (the target page/block ID, hyphenated UUID). Supports pagination via start_cursor and page_size (1–100). LLM tip: extract block_id from a Notion URL’s trailing 32-char id, then insert hyphens (8-4-4-4-12).

NameTypeRequiredDescription
block_idstringYesTarget Notion block (or page) ID to fetch comments for. Use a hyphenated UUID.
notion_versionstringNoOptional Notion-Version header override (e.g., 2022-06-28).
page_sizeintegerNoMaximum number of comments to return (1–100).
schema_versionstringNoInternal override for schema version.
start_cursorstringNoCursor to fetch the next page of results.
tool_versionstringNoInternal override for tool implementation version.

Fetch data from Notion using the workspace search API (/search). Supports pagination via start_cursor.

NameTypeRequiredDescription
page_sizeintegerNoMax number of results to return (1–100)
querystringNoText query used by /search
schema_versionstringNoOptional schema version to use for tool execution
start_cursorstringNoCursor for pagination; pass the previous response’s next_cursor
tool_versionstringNoOptional tool version to use for execution

Create a new database in Notion under a parent page. Provide a parent object with page_id, a database title (rich_text array), and a properties object that defines the database schema (columns).

NameTypeRequiredDescription
notion_versionstringNoOptional override for the Notion-Version header (e.g., 2022-06-28).
parentobjectYesParent object specifying the page under which the database is created. Example: {"page_id": "2561ab6c-418b-8072-beec-c4779fa811cf"}
propertiesobjectYesDatabase schema object defining properties (columns). Example: {"Name": {"title": {}}, "Status": {"select": {"options": [{"name": "Todo"}, {"name": "Doing"}, {"name": "Done"}]}}}
schema_versionstringNoInternal override for schema version.
titlearray<object>YesDatabase title as a Notion rich_text array.
tool_versionstringNoInternal override for tool implementation version.

Retrieve a Notion database’s full definition, including title, properties, and schema. Required: database_id (hyphenated UUID). LLM tip: Extract the last 32 characters from a Notion database URL, then insert hyphens (8-4-4-4-12).

NameTypeRequiredDescription
database_idstringYesThe target database ID in UUID format with hyphens.
notion_versionstringNoOptional override for the Notion-Version header.
schema_versionstringNoOptional schema version override.
tool_versionstringNoOptional tool version override.

Insert a new row (page) into a Notion database. Required: database_id (hyphenated UUID) and properties (object mapping database column names to Notion **property values). Optional: child_blocks(content blocks),icon(page icon object), andcover` (page cover object).

LLM guidance:

  • properties must use property values (not schema). Example:
{
"title": { "title": \[ { "text": { "content": "Task A" } } ] },
"Status": { "select": { "name": "Todo" } },
"Due": { "date": { "start": "2025-09-01" } }
}
  • Use the exact property key as defined in the database (case‑sensitive), or the property id.
  • icon example (emoji): {"type":"emoji","emoji":"📝"}
  • cover example (external): {"type":"external","external":{"url":"https://example.com/image.jpg"}}
  • Runtime note: the executor/host should synthesize parent = {"database_id": database_id} before sending to Notion.
NameTypeRequiredDescription
_parentobjectNoComputed by host: { "database_id": "<database_id>" }. Do not supply manually.
child_blocksarray<unknown>NoOptional array of Notion blocks to append as page content (paragraph, heading, to_do, etc.).
coverobjectNoOptional page cover object. Example external: {"type":"external","external":{"url":"https://example.com/cover.jpg"}}.
database_idstringYesTarget database ID (hyphenated UUID).
iconobjectNoOptional page icon object. Examples: {"type":"emoji","emoji":"📝"} or {"type":"external","external":{"url":"https://..."}}.
notion_versionstringNoOptional Notion-Version header override (e.g., 2022-06-28).
propertiesobjectYesObject mapping column names (or property ids) to property values. ️ CRITICAL: Property Identification Rules: - For title fields: ALWAYS use ‘title’ as the property key (not ‘Name’ or display names) - For other properties: Use exact property names from database schema (case-sensitive) - DO NOT use URL-encoded property IDs with special characters Recommended Workflow: 1. Call fetch_database first to see exact property names 2. Use ‘title’ for title-type properties 3. Match other property names exactly as shown in schema Example: { "title": { "title": [ { "text": { "content": "Task A" } } ] }, "Status": { "select": { "name": "Todo" } }, "Due": { "date": { "start": "2025-09-01" } } }
schema_versionstringNoOptional schema version override.
tool_versionstringNoOptional tool version override.

Query a Notion database and return only specific properties by supplying one or more property IDs. Use when you need page rows but want to limit the returned properties to reduce payload. Provide the database_id and an array of filter_properties (each item is a property id like “title”)

NameTypeRequiredDescription
database_idstringYesTarget database ID (hyphenated UUID).
property_idstringNoproperty ID to filter results by a specific property. get the property id by querying database.
schema_versionstringNoOptional schema version override.
tool_versionstringNoOptional tool version override.

Query a Notion database for rows (pages). Provide database_id (hyphenated UUID). Optional: page_size, start_cursor for pagination, and sorts (array of sort objects). LLM guidance: extract the last 32 characters from a Notion database URL and insert hyphens (8-4-4-4-12) to form database_id. Sort rules: each sort item MUST include either property OR timestamp (last_edited_time/created_time), not both.

NameTypeRequiredDescription
database_idstringYesTarget database ID (hyphenated UUID).
notion_versionstringNoOptional Notion-Version header override.
page_sizeintegerNoMaximum number of rows to return (1–100).
schema_versionstringNoOptional schema version override.
sortsarray<object>NoOrder the results. Each item must include either property or timestamp, plus direction.
start_cursorstringNoCursor to fetch the next page of results.
tool_versionstringNoOptional tool version override.

Update a Notion database’s title, description, or property schema.

NameTypeRequiredDescription
database_idstringYesThe ID of the database to update
descriptionstringNoNew description for the database
propertiesobjectNoProperty schema updates (add, rename, or reconfigure columns)
titlestringNoNew title for the database

Append blocks to a Notion page or block. Supports paragraph, heading_1/2/3, bulleted_list_item, numbered_list_item, code, quote, callout, and divider block types.

NameTypeRequiredDescription
block_idstringYesThe ID of the page or block to append content to
blocksarray<object>YesArray of blocks to append. Each block has a type and text (plus optional language for code blocks).

Retrieve the content (blocks) of a Notion page or block. Returns all child blocks with their type and text content.

NameTypeRequiredDescription
block_idstringYesThe ID of the page or block whose children to retrieve
page_sizenumberNoNumber of blocks to return (max 100)
start_cursorstringNoCursor for pagination from a previous response

Create a page in Notion either inside a database (as a row) or as a child of a page. Use exactly one parent mode: provide database_id to create a database row (page with properties) OR provide parent_page_id to create a child page. When creating in a database, properties must use Notion property value shapes and the title property key must be “title” (not the display name). Children (content blocks), icon, and cover are optional. The executor should synthesize the Notion parent object from the chosen parent input.

Target rules:

  • Use database_id OR parent_page_id (not both)
  • If database_id is provided → properties are required
  • If parent_page_id is provided → properties are optional
NameTypeRequiredDescription
_parentobjectNoComputed by the executor: {"database_id": "..."} OR {"page_id": "..."} derived from database_id/parent_page_id.
child_blocksarray<unknown>NoOptional blocks to add as page content (children).
coverobjectNoOptional page cover object.
database_idstringNoCreate a page as a new row in this database (hyphenated UUID). Extract from the database URL (last 32 chars → hyphenate 8-4-4-4-12).
iconobjectNoOptional page icon object.
notion_versionstringNoOptional Notion-Version header override.
parent_page_idstringNoCreate a child page under this page (hyphenated UUID). Extract from the parent page URL.
propertiesobjectNoFor database rows, supply property values keyed by property name (or id). For title properties, the key must be “title”. Example (database row): { "title": { "title": [ { "text": { "content": "Task A" } } ] }, "Status": { "select": { "name": "Todo" } }, "Due": { "date": { "start": "2025-09-01" } } }
schema_versionstringNoOptional schema version override.
tool_versionstringNoOptional tool version override.

Retrieve a Notion page by its ID. Returns the page properties, metadata, and parent information.

NameTypeRequiredDescription
page_idstringYesThe ID of the Notion page to retrieve

Update a Notion page’s properties, archive/unarchive it, or change its icon and cover.

NameTypeRequiredDescription
archivedbooleanNoSet to true to archive (delete) the page, false to unarchive it
coverobjectNoPage cover image to set
iconobjectNoPage icon to set
page_idstringYesThe ID of the Notion page to update
propertiesobjectNoPage properties to update using Notion property value shapes

List all users in the Notion workspace including people and bots.

NameTypeRequiredDescription
page_sizenumberNoNumber of users to return (max 100)
start_cursorstringNoCursor for pagination from a previous response