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: "Parent Block ID",
blockTypes: ["Block Type(s)"],
},
})# 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": "Parent Block ID",
"blockTypes": ["Block Type(s)"],
})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: "Parent Block ID",
blockTypes: ["Block Type(s)"],
},
})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": "Parent Block ID",
"blockTypes": ["Block Type(s)"],
},
)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": "Parent Block ID",
"blockTypes": ["Block Type(s)"]
}
}'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 new and/or existing blocks to the specified parent. See the documentationWritev0.0.3 -
Create Comment
actionCreate a comment in a page or existing discussion thread. See the documentationWritev0.0.3 -
Create Page
actionCreate a page from a parent page. See the documentationWritev0.0.3 -
Create Page from Data Source
actionCreate a page from a data source. See the documentationWritev0.0.3 -
Duplicate Page
actionCreate a new page copied from an existing page block. See the documentationWritev0.0.3 -
Find Pages or Data Sources
actionSearches for a page or data source. See the documentationWritev0.0.3 -
Query Data Source
actionQuery a data source with a specified filter. See the documentationWritev0.0.3 -
Retrieve Data Source Content
actionGet all content of a data source. See the documentationWritev0.0.3 -
Retrieve Data Source Schema
actionGet the property schema of a data source in Notion. See the documentationWritev0.0.3 -
Retrieve Page Content
actionGet page content as block objects or markdown. Blocks can be text, lists, media, a page, among others. See the documentationWritev0.0.3 -
Retrieve Page Metadata
actionGet details of a page. See the documentationWritev0.0.3 -
Retrieve Page Property Item
actionGet a Property Item object for a selected page and property. See the documentationWritev0.0.3 -
Update Page
actionUpdate a page's property values. To append page content, use the Append Block action instead. See the documentationWritev0.0.3
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.3 -
New Data Source Created
triggerEmit new event when a data source is created. See the documentationv0.0.3 -
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.3 -
New Page in Data Source
triggerEmit new event when a page is created in the selected data source. See the documentationv0.0.3 -
Page or Subpage Updated
triggerEmit new event when the selected page or one of its sub-pages is updated. See the documentationv0.0.3 -
Page Updated
triggerEmit new event when a selected page is updated. See the documentationv0.0.3
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