Connect to Notion
Connect Notion to Retool and manage pages, databases, and blocks.
Notion is a workspace platform for notes, documents, and databases.
What you can do with Notion in Retool
After you create a Notion resource in Retool, you can:
- Retrieve pages, databases, and blocks.
- Create and update pages and database entries.
- Query databases with filters and sorts.
- Build internal wikis and content dashboards on top of Notion data.
Before you begin
To connect Notion to Retool, you need the following:
- Cloud
- Self-hosted
- Notion integration: An internal integration created in your Notion integrations settings, with the pages or databases you want to access shared with it.
- Retool permissions: Ability to create and manage resources in your organization.
- Notion integration: An internal integration created in your Notion integrations settings, with the pages or databases you want to access shared with it.
- Network access: Your Retool instance must be able to reach
api.notion.comover outbound HTTPS. - Retool permissions: Ability to create and manage resources in your organization.
Create a Notion resource
Follow these steps to create a Notion resource in Retool.
Create a new resource
In your Retool organization, navigate to Resources in the main navigation and click Create new → Resource. Search for Notion and click the Notion tile to begin configuration.
Configure general settings
Specify a name and description for the resource that indicates which Notion workspace it connects to. The description provides more context to users and Assist about how to use the resource.
| Example name | Example description |
|---|---|
| Notion (Engineering wiki) | Notion workspace hosting engineering documentation and runbooks. |
| Notion (Product roadmap) | Notion database tracking the product roadmap and feature requests. |
Configure authentication
Notion resources authenticate using an API key from an internal integration.
- Copy the integration's API key from the API keys page of your Notion account.
- Paste the key into the API key field.
- In Notion, share each page or database you want Retool to access with the integration.
API key: ntn_1234567890abcdefghijklmnopqrstuvwxyz
Test the connection
Click Test connection to verify Retool can connect to Notion. If the test succeeds, you see a success message. If it fails, check the following:
- API key is correct: Confirm the key hasn't been regenerated or revoked in Notion.
- Pages are shared: Confirm the pages or databases you're querying are shared with the integration.
After testing the connection, click View in console to open the Debug Tools console. The console displays request details (URL, method, headers) and the response (status code, body), along with execution time and error details if the test fails. This information is helpful for troubleshooting connection issues.
Save the resource
Click Create resource to save your Notion resource. You can now use it in queries across your Retool apps and automations.
Interact with Notion data
Once you've created a Notion resource, you can interact with Notion data using Retool.
Retool recommends using the new app builder so you can use natural language to build React-based apps using AI.
- To use Notion data in the app builder, reference the resource in the prompt with
@, such as@Notion (Engineering wiki). Refer to the data and functions documentation to learn more. - For classic apps, workflows, and agents, refer to the REST API queries documentation to learn how to write a resource query.
Best practices
Follow these best practices to maintain the security of your Notion resource.
- Share only what's needed: Share only the specific pages or databases the integration needs with it, rather than granting workspace-wide access.
- Use configuration variables: Store the Notion API key in configuration variables or Retool secrets rather than hardcoding it in queries.
- Rotate credentials regularly: Regenerate the integration's API key on a regular schedule, and immediately if it's ever exposed.
- Use resource environments: Organizations on an Enterprise plan can configure multiple resource environments to maintain separate Notion credentials for production, staging, and development.
Related resources
Create a resource
Learn how to create and manage resources in Retool.
Resource environments
Configure separate credentials for production and non-production environments.
Configuration variables
Store sensitive values securely for use in queries and apps.
Retool community
Community discussions and solutions for connecting resources to Retool.
Notion API documentation
Official Notion API documentation.