I’m running into a problem with my Netlify serverless function. It’s supposed to grab data from a Notion database using an Internal Integration Token. But I keep getting this frustrating error: ‘Make sure the relevant pages and databases are shared with your integration.’
Here’s the weird part. I’ve already shared the database with the integration. I’ve double-checked the permissions too, and they look fine. I even tried sharing the database again, but no luck.
My code reaches the serverless function fine because I do see my custom error message (‘Internal server error’) in the catch block. However, the sharing issue persists.
I’ve set up the necessary CORS headers in my function, and it’s using the Notion client to query the database, filtering results by a username property.
Has anyone encountered this issue before? Any ideas on what I might have missed? I’m really stuck here and would appreciate any insights.
hey man, i’ve dealt with this before. it’s a pain! double-check that ur integration token has the right perms for EACH page in the db. sometimes they don’t inherit properly. also, try regenerating the token and re-sharing everything. that fixed it for me once. good luck!
I’ve run into this problem before, and it can be really frustrating. One thing that often gets overlooked is the granularity of Notion’s permissions. Even if you’ve shared the database, individual pages might not have inherited those permissions correctly.
Here’s what I’d suggest:
First, go through each page in your database manually and ensure they’re all explicitly shared with your integration. It’s tedious, but it can uncover pages that somehow didn’t get the right permissions.
Also, check the API version you’re using. Sometimes, updates to the Notion API can affect how permissions are handled. Make sure your serverless function is using a compatible version.
If nothing else works, try this last resort: create a new integration token, delete the old one, and re-share everything from scratch. It’s a pain, but it’s solved mysterious permission issues for me before.
Hope this helps you get unstuck!
I’ve encountered this issue before, and it can be pretty frustrating. One thing that’s often overlooked is the inheritance of permissions within Notion. Even if you’ve shared the database, individual pages might not automatically inherit those permissions.
Here’s what worked for me:
First, I went through each page in the database manually and made sure they were all explicitly shared with the integration. It’s tedious, but it can uncover pages that somehow slipped through the cracks.
Another thing to check is the API version you’re using. Sometimes, updates to the Notion API can affect how permissions are handled. Make sure your serverless function is using a compatible version.
If all else fails, try this nuclear option: create a new integration token, delete the old one, and re-share everything from scratch. It’s a pain, but it’s solved seemingly inexplicable permission issues for me before.
Lastly, if you’re comfortable with it, you could try using the Notion API to programmatically check permissions on each page. This can help pinpoint exactly where the issue lies. Good luck, and I hope you get it sorted soon!