How to create API integrations on Notion
Creating API integrations in Notion involves setting up an internal integration through Notion's developer portal, obtaining an API token, and configuring your external application to communicate with Notion's databases and pages. You'll need to grant proper permissions and authenticate requests using the integration token.
Prerequisites
- Basic understanding of APIs and webhooks
- Notion workspace with admin permissions
- Developer account or app to integrate with
- Understanding of authentication tokens
Step-by-Step Instructions
Create a New Integration
Copy Your Integration Token
secret_ and is required for all API requests.Configure Integration Capabilities
- Read content - allows reading pages and databases
- Update content - allows editing existing content
- Insert content - allows creating new pages and database entries
Share Database or Page with Integration
Set Up API Requests in Your Application
https://api.notion.com/v1/. Include these headers in all requests:Authorization: Bearer YOUR_INTEGRATION_TOKEN
Notion-Version: 2022-06-28
Content-Type: application/jsonTest Database Integration
/v1/databases/{database_id}. You can find the database ID in the URL when viewing your database in Notion - it's the string of characters before any query parameters.Implement Data Operations
POST /v1/pages- create new database entriesPATCH /v1/pages/{page_id}- update existing pagesPOST /v1/databases/{database_id}/query- query database entries
Monitor and Maintain Integration
Common Issues & Troubleshooting
Getting 401 Unauthorized error
Verify your integration token is correct and included in the Authorization header as Bearer YOUR_TOKEN. Ensure the integration has been shared with the specific database or page you're trying to access.
Cannot find database or page
Check that the database/page ID is correct and that you've explicitly shared the resource with your integration through the Share menu. The integration won't have access even with a valid token unless explicitly granted.
Rate limit exceeded errors
Implement rate limiting in your application to stay under 3 requests per second. Add exponential backoff when receiving 429 status codes and consider batching operations where possible.
Properties not updating correctly
Verify that your JSON payload matches Notion's property type requirements exactly. Check the database schema using GET /v1/databases/{id} to confirm property names and types before updating.