I keep getting a 404 error with the message object_not_found when trying to access my Notion database through the API. I have already set up the connection between my database and my integration properly.
I’m using the correct bearer token from my integration when making requests through Postman. The database shows up as connected to my integration in the Notion interface. My workspace is also properly linked to the integration.
I double checked the database ID I’m using in my API calls and it matches what I see in Notion. The authorization token is definitely correct since I copied it directly from my integration settings.
I followed the official Notion API documentation for setting up connections but I’m still getting this error. What could be causing this 404 response even when everything appears to be configured correctly?
Check if your database is actually shared with the integration at the page level. Even though it shows connected in settings, each database needs explicit permission. Go to your database in Notion, hit the three dots, select “Add connections” and manually add your integration. Also make sure you’re hitting the right endpoint - use /v1/databases/{database_id}/query for querying content, not /v1/databases/{database_id}. I got similar 404s when my database got archived or moved to a different workspace without updating integration access. The connection status in integration settings lies if workspace permissions changed after you set it up.
Check your Notion-Version header. I hit the same 404 issue using an old API version that couldn’t recognize newer database IDs. Even with perfect permissions and formatting, outdated headers throw object_not_found errors. Use 2022-06-28 or later. Also check if your database came from a template or import - these sometimes have broken ID references that look fine but point nowhere. Quick test: create a fresh database and try your API call on that. If it works, your original database has hidden ID corruption you can’t see in the UI.
Had this exact issue last month - drove me crazy for hours. Turned out I was using the database URL ID instead of the actual database ID the API wants. When you copy the ID from your Notion URL, you’ve got to format it properly with hyphens in the right spots. The raw URL ID won’t work. Also check you’re using the right API version in your headers - I had an outdated version causing the same errors. Try making a fresh integration and reconnecting it to your database. Sometimes there’s permission issues that aren’t obvious in the interface.
Been there way too many times. Debugging Notion API errors manually is a nightmare - you’re jumping between Postman, checking permissions, regenerating tokens, and still hitting walls.
I ditched this headache by setting up automated monitoring for all my Notion integrations. Built a workflow that tests connections every hour and handles token refresh, permission checks, and database ID validation automatically. When something breaks, it logs what failed and tries common fixes.
The workflow also fixes those tricky database ID formatting issues automatically. No more copy-paste errors or manual UUID formatting.
For your current problem, try querying the integration capabilities first to see what databases it can actually access. That’ll tell you if it’s permissions or ID issues. But honestly, proper automation means you’ll never debug this stuff manually again.
sounds like workspace permissions are acting up. try regenerating your integration token completely - that usually fixes it. notion gets weird about cached permissions even when everything looks fine. also double-check you’re not hitting a staging/test database id that got deleted.
This happens when your database is nested inside another page and the integration can only access the parent page, not the database itself. The API sees the connection but can’t actually reach the database. Go to your database page in Notion and check if there’s a parent page above it that’s blocking access. Databases created inside other pages sometimes get weird permission layers that don’t play nice with integrations. Also check if you recently duplicated this database or restored it from a template - that stuff breaks the original database ID mappings even though the URL looks the same. Try making a simple test database at your workspace root level and see if the integration can access that one.
notion’s cache might be playing tricks on ya. try completely disconnecting the integration from the database, wait 5 min, and then reconnect. also, make sure you’re not getting mixed up with a page ID, they look alike but the api sees em different.