CONNECT APP
Build with Notion (API Key)
Productivity
- API key
MCP
Give your agent Notion (API Key) tools
Every Notion (API Key) action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Notion (API Key) account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "notion_api_key",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Append Block to Parent:
const result = await mcp.callTool({
name: "notion_api_key-append-block",
arguments: {
pageId: "Page ID or URL",
content: "Content",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "notion_api_key",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Append Block to Parent:
result = await session.call_tool("notion_api_key-append-block", {
"pageId": "Page ID or URL",
"content": "Content",
})SDK
Run Notion (API Key) actions from your backend
Connect a user's Notion (API Key) account once, then run Append Block to Parent on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "notion_api_key-append-block",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
notion_api_key: { authProvisionId: "apn_xxxxxxx" },
pageId: "Page ID or URL",
content: "Content",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="notion_api_key-append-block",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"notion_api_key": {"authProvisionId": "apn_xxxxxxx"},
"pageId": "Page ID or URL",
"content": "Content",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "notion_api_key-append-block",
"configured_props": {
"notion_api_key": { "authProvisionId": "apn_xxxxxxx" },
"pageId": "Page ID or URL",
"content": "Content"
}
}'TOOLS
Notion (API Key) actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Append Block to Parent
actionAppend Markdown content to the bottom of a Notion page (or block). Thecontentis parsed from Markdown into Notion blocks — use it to add paragraphs, headings, bullet/numbered lists, to-dos, quotes, code, etc. Provide the page ID or URL (use Search to resolve a page name into an ID). To change a database row's property values instead, use Update Page. See the documentationWritev0.0.5 -
Copy Page From Template
actionCopy an EXISTING page (template) into a new page with a new title. Use this ONLY when the user is reusing the structure of an existing page as a template (e.g. "copy this offer letter template for a new candidate"). Do NOT use to create a new page with original content — for that, use Create Page. The source page must already exist in Notion and is identified by its page ID. See the documentationWritev0.0.5 -
Create Comment
actionAdd a comment to a Notion page, or reply to an existing discussion thread. Provide either a page ID/URL (use Search to resolve a page name) or a discussion ID — not both. See the documentationWritev0.0.5 -
Create Page
actionCreate a new Notion page. Theparentcan be either another page (creates a subpage) or a database/data source (creates a row in that database). Provide the parent's ID or URL — use Search to resolve a name into an ID. When the parent is a database, setpropertiesto a flat JSON object of column-name → value (e.g.{ "Status": "Active", "ThreatLevel": 9 }); call Retrieve Database Schema first to learn the exact column names and valid select options.contentis the page body as Markdown (headings, bullet lists, paragraphs, etc.). See the documentationWritev0.0.5 -
Create Page from Data Source
actionCreate a new page (row) in a Notion data source (database). Provide the parent data source ID and the row's field values as a JSON object keyed by column name. Use the Search action (withfilter: data_source) to resolve a database name into its data source ID, and Retrieve Database Schema to learn the exact column names and types before setting values. Optionally add page body content withPage Content(Markdown). Example: parentDataSource"a1b2c3d4-..."with properties{ "Name": "Q1 Report", "Status": "In Progress", "Tags": ["finance"] }→ creates a new row with those fields and returns the created page object. See the documentationWritev0.0.5 -
Get Page
actionRetrieve a Notion page: both its property values and its body content rendered as Markdown. Use this to read what a page says or to inspect a database row's fields. Provide a page ID or a Notion page URL (use Search to resolve a page name into an ID). See the documentationRead-onlyv0.0.5 -
Query Data Source
actionFilter and sort the pages (rows) inside a Notion database (data source) by their property values. Discover exact property names and option values with Retrieve Database Schema first, then build a filter against them. Afilteris a JSON object: a single condition{ "property": "Status", "select": { "equals": "Escaped" } }, or a compound{ "and": [ ... ] }/{ "or": [ ... ] }. The condition key matches the property type — e.g.select,status,multi_select,number({ "greater_than": 5 }),checkbox({ "equals": true }),rich_text/title({ "contains": "..." }),date. Omitfilterto return all rows. Provide the data source ID (use Search withfilter: data_sourceto resolve a database name). See the documentationRead-onlyv0.0.5 -
Retrieve Data Source Content
actionGet all content of a data source. See the documentationRead-onlyv0.0.5 -
Retrieve Database Schema
actionGet the column (property) schema of a Notion database (data source): each property's name, type, and — forselect/multi_select/statuscolumns — its allowed option values. Call this before Query Data Source, Create Page, or Update Page on a database so you use exact property names and valid option values. Provide the data source ID (use Search withfilter: data_sourceto resolve a database name into its ID). See the documentationRead-onlyv0.0.5 -
Retrieve Page Content
actionGet page content as block objects or markdown. Blocks can be text, lists, media, a page, among others. Example: blockId"1a2b3c4d-..."with Retrieve Children set toAll Childrenand Retrieve as Markdown enabled → returns the block with its nestedchildrenarray plus amarkdownContentstring of the page text. See the documentationRead-onlyv0.0.5 -
Retrieve Page Property Item
actionGet a Property Item object for a selected page and property. See the documentationRead-onlyv0.0.5 -
Search
actionSearch Notion for pages and databases (data sources) by title. Use this first to resolve a page or database name into an ID that the other Notion tools require (e.g. Query Data Source, Retrieve Database Schema, Get Page, Create Page). Leavequeryblank to list everything the integration can access. Setfiltertodata_sourceto find databases orpageto find pages — on the current Notion API a database is returned as adata_sourceobject, and itsidis the data source ID you pass to the database tools. See the documentationRead-onlyv0.0.5 -
Update Page
actionUpdate a Notion page's property values, and/or archive (delete) it. Properties you don't include are left unchanged. Provide the page ID or URL (use Search or Query Data Source to find it). Setpropertiesto a flat JSON object of column-name → value, e.g.{ "Status": "Contained" }; call Retrieve Database Schema first to learn the exact column names and valid select options. To add body content instead of changing properties, use Append Block to Parent. See the documentationWritev0.0.5
EVENTS
Notion (API Key) triggers
Event sources your backend can deploy for users and receive through a webhook.
-
New Comment Created
triggerEmit new event when a new comment is created in a page or block. See the documentationv0.0.5 -
New Data Source Created
triggerEmit new event when a data source is created. See the documentationv0.0.5 -
New or Updated Page in Data Source (By Property)
triggerEmit new event when a page is created or updated in the selected data source. See the documentationv0.0.5 -
New Page in Data Source
triggerEmit new event when a page is created in the selected data source. See the documentationv0.0.5 -
Page or Subpage Updated
triggerEmit new event when the selected page or one of its sub-pages is updated. See the documentationv0.0.5 -
Page Updated
triggerEmit new event when a selected page is updated. See the documentationv0.0.5
MULTI-APP
Use Notion (API Key) with other popular apps
Most products don't stop at one integration. Pair Notion (API Key) with the other apps your users rely on, and ship use cases that span both.
REFERENCE
App details
Reference metadata for the Notion (API Key) connector in the Pipedream registry.
- App slug
- notion_api_key
- Authentication
- API key
- Categories
- Productivity
- Actions
- 13
- Triggers
- 6
- API proxy
- Not available