> ## Documentation Index
> Fetch the complete documentation index at: https://nango.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Notion

> Integrate your application with the Notion API

## 🚀 Quickstart

Connect to Notion with Nango and see data flow in 2 minutes.

<Steps>
  <Step title="Create the integration">
    In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Notion*.
  </Step>

  <Step title="Authorize Notion">
    Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Authorize*, then log in to Notion. Later, you'll let your users do the same directly from your app.
  </Step>

  <Step title="Call the Notion API">
    Let's make your first request to the Notion API (fetch a list of users). Replace the placeholders below with your [secret key](https://app.nango.dev/dev/environment-settings), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl "https://api.nango.dev/proxy/v1/users" \
          -H "Authorization: Bearer <NANGO-SECRET-KEY>" \
          -H "Provider-Config-Key: <INTEGRATION-ID>" \
          -H "Connection-Id: <CONNECTION-ID>"
        ```
      </Tab>

      <Tab title="Node">
        Install Nango's backend SDK with `npm i @nangohq/node`. Then run:

        ```typescript theme={null}
        import { Nango } from '@nangohq/node';

        const nango = new Nango({ secretKey: '<NANGO-SECRET-KEY>' });

        const res = await nango.get({
          endpoint: '/v1/users',
          providerConfigKey: '<INTEGRATION-ID>',
          connectionId: '<CONNECTION-ID>'
        });

        console.log(JSON.stringify(res.data, 2, null));
        ```
      </Tab>
    </Tabs>

    Or fetch credentials with the [Node SDK](/reference/sdks/node#get-a-connection-with-credentials) or [API](/reference/api/connection/get).

    ✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.
  </Step>

  <Step title="Implement Nango in your app">
    Follow our [Auth implementation guide](/guides/primitives/auth) to integrate Nango in your app.

    To obtain your own production credentials, follow the setup guide linked below.
  </Step>
</Steps>

## 📚 Notion Integration Guides

Nango maintained guides for common use cases.

* [How to register your own Notion OAuth app](/api-integrations/notion/how-to-register-your-own-notion-api-oauth-app)\
  Register an OAuth app with Notion and obtain credentials to connect it to Nango

Official docs: [Notion API documentation](https://developers.notion.com/reference/intro)

## 🧩 Pre-built syncs & actions for Notion

Enable them in your dashboard. Extend and customize to fit your needs.

### Blocks

| Function name             | Description                                                 | Type                                         | Source code                                                                                                                    |
| ------------------------- | ----------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `append-block-children`   | Append new child blocks to an existing block or page.       | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/append-block-children.ts)   |
| `append-bulleted-list`    | Adds bulleted list items to a page.                         | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/append-bulleted-list.ts)    |
| `append-callout-block`    | Adds a callout block with icon to a page.                   | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/append-callout-block.ts)    |
| `append-code-block`       | Adds a code block with syntax highlighting to a page.       | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/append-code-block.ts)       |
| `append-divider`          | Adds a horizontal divider to a page.                        | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/append-divider.ts)          |
| `append-heading-block`    | Adds a heading block to a page.                             | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/append-heading-block.ts)    |
| `append-todo-block`       | Adds a to-do/checkbox item to a page.                       | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/append-todo-block.ts)       |
| `delete-block`            | Delete or archive a block by ID.                            | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/delete-block.ts)            |
| `list-block-children`     | List child blocks for a page or block with pagination.      | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/list-block-children.ts)     |
| `retrieve-block`          | Retrieve a single block by block ID.                        | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/retrieve-block.ts)          |
| `retrieve-block-children` | Gets paginated list of child blocks within a block or page. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/retrieve-block-children.ts) |
| `update-block`            | Update a block's supported fields or rich text content.     | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/update-block.ts)            |

### Comments

| Function name      | Description                                             | Type                                         | Source code                                                                                                             |
| ------------------ | ------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `create-comment`   | Create a comment on a page, block, or discussion thread | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/create-comment.ts)   |
| `list-comments`    | List comments for a page or discussion thread.          | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/list-comments.ts)    |
| `retrieve-comment` | Retrieve a Notion comment by comment ID                 | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/retrieve-comment.ts) |

### Data Sources

| Function name                | Description                                                             | Type                                         | Source code                                                                                                                       |
| ---------------------------- | ----------------------------------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `create-data-source`         | Create a Notion data source in its supported parent container.          | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/create-data-source.ts)         |
| `list-data-source-templates` | List templates available for a data source.                             | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/list-data-source-templates.ts) |
| `query-data-source`          | Query entries in a Notion data source using filters and sorts.          | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/query-data-source.ts)          |
| `retrieve-data-source`       | Retrieve a Notion data source definition and schema.                    | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/retrieve-data-source.ts)       |
| `update-data-source`         | Update a Notion data source's title, description, or schema properties. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/update-data-source.ts)         |

### Databases

| Function name             | Description                                                          | Type                                         | Source code                                                                                                                    |
| ------------------------- | -------------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `query-database-filtered` | Retrieves pages from database matching filter conditions.            | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/query-database-filtered.ts) |
| `query-database-sorted`   | Retrieves pages from database in sorted order.                       | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/query-database-sorted.ts)   |
| `query-database`          | Retrieves filtered and sorted pages from a database with pagination. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/query-database.ts)          |
| `retrieve-database`       | Gets database schema and column structure.                           | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/retrieve-database.ts)       |
| `update-database`         | Modifies database title, description, or properties schema.          | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/update-database.ts)         |

### Pages

| Function name            | Description                                                                                                               | Type                                         | Source code                                                                                                                   |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `archive-page`           | Archive a page so it is removed from active workspace views.                                                              | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/archive-page.ts)           |
| `create-page`            | Create a new Notion page with properties and optional children.                                                           | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/create-page.ts)            |
| `duplicate-page`         | Duplicate a Notion page and its content                                                                                   | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/duplicate-page.ts)         |
| `get-page-as-markdown`   | Retrieve a page in the current markdown export format if available.                                                       | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/get-page-as-markdown.ts)   |
| `get-page-property-item` | Retrieve a single property item value from a page.                                                                        | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/get-page-property-item.ts) |
| `move-page`              | Move a Notion page to a new parent location (under another page or into a database).                                      | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/move-page.ts)              |
| `restore-page`           | Restore a page from trash so it returns to active workspace views.                                                        | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/restore-page.ts)           |
| `retrieve-page-property` | Gets a specific property value from a page with pagination support.                                                       | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/retrieve-page-property.ts) |
| `retrieve-page`          | Retrieve a Notion page and its property values.                                                                           | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/retrieve-page.ts)          |
| `update-page-markdown`   | Update page content using markdown commands. Supports targeted edits, full replacement, insertion, and range replacement. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/update-page-markdown.ts)   |
| `update-page`            | Update page properties and other mutable page fields.                                                                     | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/update-page.ts)            |

### Search

| Function name      | Description                                                      | Type                                         | Source code                                                                                                             |
| ------------------ | ---------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `search-databases` | Searches only databases shared with the integration.             | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/search-databases.ts) |
| `search-pages`     | Searches only pages shared with the integration.                 | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/search-pages.ts)     |
| `search`           | Search pages, data sources, and other searchable Notion objects. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/search.ts)           |

### Users

| Function name   | Description                                                          | Type                                         | Source code                                                                                                          |
| --------------- | -------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `get-bot-user`  | Retrieve the bot user associated with the current integration token. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/get-bot-user.ts)  |
| `get-user`      | Retrieve a Notion user or bot by user ID                             | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/get-user.ts)      |
| `list-users`    | List Notion users and bots available to the integration.             | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/list-users.ts)    |
| `retrieve-user` | Gets a single user by their ID.                                      | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/actions/retrieve-user.ts) |

### Others

| Function name           | Description                                                                | Type                                           | Source code                                                                                                                |
| ----------------------- | -------------------------------------------------------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `content-metadata`      | Sync page and data source metadata for broad Notion content discovery.     | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/syncs/content-metadata.ts)      |
| `data-source-entries`   | Sync page entries from a Notion data source with properties and timestamps | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/syncs/data-source-entries.ts)   |
| `data-source-templates` | Sync templates available for a Notion data source                          | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/syncs/data-source-templates.ts) |
| `data-sources`          | Sync Notion data source definitions and schema metadata.                   | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/syncs/data-sources.ts)          |
| `users`                 | Sync Notion users and bots visible to the integration.                     | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/notion/syncs/users.ts)                 |

***
