# Notion (API Key) — Pipedream Connect

> Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.

- API slug: `notion_api_key` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Productivity
- Website: https://notion.so/
- This page (HTML): https://pipedream.com/apps/notion-api-key
- Tools: 13 actions · 6 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: notion_api_key`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
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 accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_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)"],
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## SDK

```ts
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)"],
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (13)

### `notion_api_key-append-block` — Append Block to Parent (Write)

Append new and/or existing blocks to the specified parent. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/append-block.md

### `notion_api_key-create-comment` — Create Comment (Write)

Create a comment in a page or existing discussion thread. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/create-comment.md

### `notion_api_key-create-page` — Create Page (Write)

Create a page from a parent page. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/create-page.md

### `notion_api_key-create-page-from-database` — Create Page from Data Source (Write)

Create a page from a data source. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/create-page-from-database.md

### `notion_api_key-duplicate-page` — Duplicate Page (Write)

Create a new page copied from an existing page block. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/duplicate-page.md

### `notion_api_key-search` — Find Pages or Data Sources (Write)

Searches for a page or data source. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/search.md

### `notion_api_key-query-database` — Query Data Source (Write)

Query a data source with a specified filter. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/query-database.md

### `notion_api_key-retrieve-database-content` — Retrieve Data Source Content (Write)

Get all content of a data source. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/retrieve-database-content.md

### `notion_api_key-retrieve-database-schema` — Retrieve Data Source Schema (Write)

Get the property schema of a data source in Notion. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/retrieve-database-schema.md

### `notion_api_key-retrieve-block` — Retrieve Page Content (Write)

Get page content as block objects or markdown. Blocks can be text, lists, media, a page, among others. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/retrieve-block.md

### `notion_api_key-retrieve-page` — Retrieve Page Metadata (Write)

Get details of a page. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/retrieve-page.md

### `notion_api_key-retrieve-page-property-item` — Retrieve Page Property Item (Write)

Get a Property Item object for a selected page and property. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/retrieve-page-property-item.md

### `notion_api_key-update-page` — Update Page (Write)

Update a page's property values. To append page content, use the Append Block action instead. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/actions/update-page.md

## Triggers (6)

### `notion_api_key-new-comment-created` — New Comment Created (Polling)

Emit new event when a new comment is created in a page or block. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/triggers/new-comment-created.md

### `notion_api_key-new-database` — New Data Source Created (Polling)

Emit new event when a data source is created. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/triggers/new-database.md

### `notion_api_key-updated-page` — New or Updated Page in Data Source (By Property) (Polling)

Emit new event when a page is created or updated in the selected data source. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/triggers/updated-page.md

### `notion_api_key-new-page` — New Page in Data Source (Polling)

Emit new event when a page is created in the selected data source. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/triggers/new-page.md

### `notion_api_key-page-or-subpage-updated` — Page or Subpage Updated (Polling)

Emit new event when the selected page or one of its sub-pages is updated. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/triggers/page-or-subpage-updated.md

### `notion_api_key-updated-page-id` — Page Updated (Polling)

Emit new event when a selected page is updated. See the documentation

Full schema: https://pipedream.com/apps/notion-api-key/triggers/updated-page-id.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
