> ## Documentation index
> Fetch the complete documentation index at: https://context7.com/docs/llms.txt
> Ask it with GET https://context7.com/docs/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://context7.com/docs/resources/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://context7.com/docs/feedback?path=/docs/enterprise/integrations/notion&helpful={true|false}&comment={comment}` records whether this page helped. The `comment` (URL-encoded, at most 500 characters) says what helped, or what was missing or wrong; a `helpful=false` rating needs it. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Notion Integration

> Sync approved Notion pages and database rows with Context7 Enterprise

An admin connects a Notion workspace under **Workspace Settings › Notion** and chooses content from **Add source → Notion**. A selected page includes its accessible child pages and the rows of nested databases. A selected data source includes its rows, each indexed as a separate page.

## Set up the connection

<Steps>
  <Step title="Create an internal connection">
    In the [Notion developer portal](https://www.notion.so/profile/integrations), create an internal connection for your workspace. Enable **Read content** and copy the connection token.
  </Step>
  <Step title="Share the content">
    In Notion, open each approved page or database and use **••• → Connections** to add the connection. You can also grant access from the connection's **Content access** tab.
  </Step>
  <Step title="Connect Context7">
    Open **Workspace Settings › Notion**. Paste the token, choose **Test connection**, then **Connect**. The test shows the bot, workspace when available, and up to 10 accessible items. Context7 stores the token encrypted and displays only its last four characters.
  </Step>
</Steps>

Use an internal connection so workspace admins can choose what it sees. Personal access tokens and public OAuth connections are not supported.

## Add a library

Open **Add source → Notion**, select pages and data sources, enter a title, and add the library. If a database contains several data sources, select the ones you want to index. Preview and picker results can lag after sharing; refresh the list if an item is missing.

The default limit is 10,000 pages per library. Set `NOTION_MAX_PAGES` on the Enterprise server to change the limit. Notion also caps each data source query at 10,000 rows. If a selection exceeds either limit, choose a smaller set of pages or data sources.

## Sync and monitor libraries

The default schedule is daily at 03:00 in the server timezone. Change or disable it under **Workspace Settings › Notion**, or choose **Sync all now**. From a library, choose **Refresh** to sync it alone, or **Re-index all pages** to rebuild it.

Context7 lists the selected content each time. It checks page and block edit timestamps to skip Markdown retrieval, extraction, and embedding for unchanged pages. It still reads the block tree to find child pages and databases, since Notion search can omit accessible items. Deleted, trashed, or unshared content leaves the index after a successful listing. If a page fails to load or extract, its last indexed version remains available where possible. A failed listing leaves the live library in place. When the whole sync job fails, Context7 retries after 15 minutes, 1 hour, and 6 hours. Individual page failures retry on the next sync.

The Notion card shows the last sync, unavailable selections, and failed pages. Open a failed page in Notion to check access, or export all failures as CSV.

## Access and disconnecting

Notion sharing controls what the connection can import. Enterprise library access rules control who can query the indexed content. Set those rules for the people who should have access to the library.

Disconnecting Notion or revoking the token stops successful syncs. Replacing the connection with a different bot also stops syncs for libraries tied to the old bot. Existing indexed content stays available in these cases. Delete the old Enterprise library if you want to stop serving its content. With a working connection, unsharing an individual page removes it after a successful discovery and sync.

## Authority labels

Use the title path inside the selection to match authority labels, for example `Quality/Release checks/Console`. Search results link to their original Notion pages.

## Network and rate limits

Allow outbound HTTPS to `api.notion.com`. For a trusted proxy, set `NOTION_API_URL` to its Notion API base URL, including `/v1`.

At one Markdown request per page, downloading 10,000 pages takes at least 56 minutes at 180 requests per minute or 17 minutes at 600 requests per minute. Discovery requests, long pages, extraction, embedding, and retries add time. With roughly one child listing per page as well, the API lower bounds are about 111 and 33 minutes respectively. Large hierarchies can require additional calls. Notion throttles data source queries separately.

Context7 defaults to 180 requests per minute. On Notion Business or Enterprise, set `NOTION_REQUESTS_PER_MINUTE=600` to use the higher budget. Other integrations can still exhaust a workspace's shared budget. See [Notion's request limits](https://developers.notion.com/reference/request-limits).

## Troubleshooting

- **Nothing appears in the picker:** Check the connection has **Read content** and is attached to the page or database. Refresh the picker after sharing.
- **The token was rejected:** Paste a current internal connection token from the intended workspace. Rotate a token by saving a replacement for the same connection.
- **The library says the connection changed:** Add the library again using the new connection and review the selections.
- **A sync reports too many pages:** Select fewer roots or data sources. The existing index remains available when the listing cannot complete.
