Developers can use Notion’s public REST API to interact with Notion workspaces programmatically. Interactions include working with:
- Pages
- Databases
- Users
- Page and inline comments
- Querying workspace content
- Authenticating integrations
- Customizing unfurled links
All workspace interactions, such as the above, need to be attributed to a Notion user. To accommodate this requirement for interactions made programmatically, Notion allows for API requests to be attributed to a "bot". To define the capabilities of a bot, developers build integrations, which handle authenticating API requests for the bot, defining when requests should be made, and the read/write capabilities of the integration.
In other words, using Notion’s public API means building an integration — the blueprint for how a bot can interact with your workspace — and attributing the REST API requests that are made to the bot.
There are two main types of integrations:
- Internal
- Public, which include Link Previews
Below are the steps to get started with an itnernal integration using a database template we have provided.
1. To make use of this API collection collection as it's written, please duplicate this database template.
You will need to create an integration to retrieve an API token. You will also need additional values, such as a database ID and page ID, which can be found in your Notion workspace or from the database template mentioned above.
2. You will need to create an integration to retrieve an API token on our developer portal
For our full documentation, including sample integrations and guides, visit developers.notion.com.
Please note: Pages that are parented by a database must have the same properties as the parent database. If you are not using the database template provided, the request body for the page endpoints included in this collection should be updated to match the properties in the parent database being used. See documentation for Creating a page for more information.
To learn more about creating an access token, see our official documentation and read our Authorization guide. Need more help?
need confirmation on page ID, and additional details for step #5 "Adding data to a variable"