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

# Connecting Notion to your app

> Read and write Notion pages and databases, add comments and run workflows from your app, using one shared Notion account or each person's own Notion account.

Connect your app to Notion to read and write pages and databases, add comments and run workflows when something changes in your Notion workspace. Use one shared account for your whole app or let each person connect their own Notion account.

***

## What you can do

Bring your Notion pages and databases into your app's workflows.

> [card] Sync databases
>
> Show rows from a Notion database in your app, or keep a database in step with your app's records.

> [card] Write pages
>
> Create Notion pages from your app, such as a page for every new client, or add updates to an existing page.

> [card] Work with comments
>
> Read the comments on a page and add new ones from your app.

> [card] [Run workflows](https://docs.base44.com/Building-your-app/Creating-workflows.md#connector)
>
> Start a workflow when a page or database is created, updated, moved or deleted, or when someone comments.

**Example prompts**

Describe the page or database, what triggers the action, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Sync a Notion database with my CRM records.
```

```text wrap theme={null}
Write project updates from this app into a Notion page.
```

```text wrap theme={null}
Show Notion checklist progress for team onboarding in my dashboard.
```

```text wrap theme={null}
Create new Notion pages for every new client added in my app.
```

***

## Connecting Notion

Choose how people connect: one shared account for your whole app, or each person's own account.

> [tab] Shared connector
>
> Connect one Notion account. Every app that uses the connection, and everyone who uses those apps, shares it and the pages it can see.
>
> **To add a shared Notion connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
>
> 2. Click **Add connector**.
>
> 3. Search for **Notion** and click it.
>
> 4. Select **Shared connector**, then click **Next**.
>
> 5. Enter a **Connection name**.
>
> 6. Choose where the connection can be used under **Who can access**:
>    * **Apps and Super agent:** Your apps and your Superagent can both use it. This is the default.
>    * **Apps only:** Only your apps can use it.
>    * **Super agent only:** Only your Superagent can use it.
>
> 7. Choose what your app can do under **Permissions**. **read content** and **read comment** are already selected. Add any of these your app needs:
>
>    * **insert content:** Create pages and add database rows.
>    * **update content:** Change existing pages and database rows.
>    * **insert comment:** Add comments.
>
>    ![Shared Notion connector setup showing Connection name, Who can access, and Permissions with read content and read comment selected](https://mintcdn.com/base44/astRE1z0rD_F1xsn/images/apps-connectors-notion-shared-setup.png?fit=max\&auto=format\&n=astRE1z0rD_F1xsn\&q=85\&s=4613834e2b9b1e12620ed0d4c2e5a189)
>
>    Setting up a shared Notion connector
>
> 8. Click **Add connector**.
>
> 9. Sign in to Notion and choose the pages your app can use. Learn more in Notion's guide to [installing a connection](https://www.notion.com/help/add-and-manage-connections-with-the-api#install-directly-from-a-partner-platform-via-oauth).

> [tab] App user connector
>
> Each person connects their own Notion account, so your app can work with the pages they choose to share.
>
> > [!WARNING]
> >
> > Only workspace owners and admins can set this up.
>
> > [!TIP]
> >
> > **Before you set this up:** You need a public Notion integration and its Client ID and Client Secret. See [Using your own OAuth client](https://docs.base44.com/Integrations/Connectors.md#using-your-own-oauth-client).
>
> **To add an app user Notion connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
>
> 2. Click **Add connector**.
>
> 3. Search for **Notion** and click it.
>
> 4. Select **App user connector**, then click **Next**.
>
> 5. Copy the **Callback URL**.
>
> 6. Add the Callback URL as a redirect URI in your Notion integration's settings.
>
> 7. Fill in the **Add Notion Connection** form:
>
>    * **Connector name:** A name you'll recognize later.
>    * **Client ID** and **Client Secret:** Copy these from your Notion integration's settings.
>
>    ![Add Notion Connection form with Callback URL, Connector name, Client ID and Client Secret](https://mintcdn.com/base44/astRE1z0rD_F1xsn/images/apps-connectors-notion-app-user-credentials.png?fit=max\&auto=format\&n=astRE1z0rD_F1xsn\&q=85\&s=2d7f3ef817379a121bb34c45ca966c6a)
>
>    Entering your Notion integration's credentials
>
> 8. Click **Add Connector**.
>
> 9. Open your app in the app editor.
>
> 10. Ask the AI chat to add a way for people to connect their own Notion account.

***

## Scopes and permissions

You control your app's Notion access in 2 places. In Base44, you choose what your app can do. In Notion, whoever signs in chooses which pages it can see.

> [card]
>
> **1. You choose in Base44**
>
> For a shared connector, choose what your app can do under **Permissions**. Your app can read pages, databases and comments by default. Add the write permissions when it also needs to create or change pages, rows or comments.
>
> For an app user connector, what your app can do comes from the capabilities set on your Notion integration.
>
> **2. You choose in Notion**
>
> Whoever signs in to Notion picks the pages your app can use. That's you for a shared connector, and each person for an app user connector. Learn more in Notion's guide to [installing a connection](https://www.notion.com/help/add-and-manage-connections-with-the-api#install-directly-from-a-partner-platform-via-oauth).
>
> **Access:** Your app works with the pages and databases shared during sign-in, in the Notion workspace the person signed in to. Each connection shows its Notion workspace name, so you can tell connections apart.

***

## Using backend functions

Once Notion is connected, your backend functions can retrieve an access token and call the Notion API directly. Base44 handles sign-in for you.

* For a shared connection, use `getConnection()` to retrieve the token.
* For an app user connection, use `getCurrentAppUserConnection()` so each request uses the signed-in person's token.

Call the Notion API at `api.notion.com`. Pass the token in the `Authorization` header and the API version in the `Notion-Version` header:

```javascript theme={null}
// Shared connection: one account the whole app uses
const { accessToken } = await base44.asServiceRole.connectors.getConnection("notion");

const response = await fetch("https://api.notion.com/v1/search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${accessToken}`,
    "Notion-Version": "2025-09-03",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ query: "Clients" }),
});
const { results } = await response.json();
```

> [card] [Shared connectors](https://docs.base44.com/developers/backend/resources/connectors/shared-connectors.md)
>
> Configure, deploy, and call a shared connection from a backend function.

> [card] [App user connectors](https://docs.base44.com/developers/backend/resources/connectors/app-user-connectors.md)
>
> Retrieve a per-user token and call the API as the signed-in person.

***

## Troubleshooting

Check the connection and the pages it can see if Notion stops working in your app.

> [accordion] The connection needs to be reconnected
>
> If your app loses access to Notion or its sign-in expires, the connection shows a **Reconnect this connection** section.
>
> * **Shared connector:** [Reconnect it](https://docs.base44.com/Integrations/Connectors.md#managing-your-connectors) and sign in with the same Notion account. Every app that uses it works again.
> * **App user connector:** Each person reconnects their own Notion account from inside your app.

> [accordion] Your app can't find a page or database
>
> Your app only sees the pages shared with the connection. Reconnect it and pick the page in Notion, or [add the connection to the page](https://www.notion.com/help/add-and-manage-connections-with-the-api#add-connections-to-pages) in Notion.

> [accordion] A workflow runs too often
>
> Notion sends an event every time a page's content changes, so a busy workspace can start a workflow many times. Ask the AI chat to add a condition so the workflow only runs for one page or database.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.