I’m having trouble with the Notion API. It’s giving me a 404 status with an ‘object_not_found’ error. I’ve double-checked everything:
My database is linked to my Notion Integration
I’m using the right database ID
My Notion Workspace is connected to the Integration
I’ve triple-checked the bearer token in my Postman request
I’ve gone through the setup process step by step, but it’s still not working. Any ideas what could be causing this? Maybe I’m missing something obvious?
Here’s a code snippet of how I’m making the request:
I encountered a similar issue when working with the Notion API. One often overlooked cause of the ‘object_not_found’ error is incorrect permissions. Even if your integration is connected to the workspace and database, it might not have the necessary access rights.
To resolve this, go to your database in Notion, click ‘Share’ in the top right, and ensure your integration is listed there with ‘Can edit’ permissions. If it’s not, add it manually.
Also, double-check that you’re using the correct database ID. It should be a 32-character string found in the database URL. Lastly, verify that your bearer token hasn’t expired. Regenerating it in the Notion developers portal might solve the issue.
If none of these work, try creating a new integration and connecting it to your database. Sometimes, this fresh start can resolve persistent API issues.
Hey there, I’ve dealt with this frustrating issue before. One thing that often gets overlooked is the Notion-Version header. In your code snippet, you’re using ‘2022-06-28’, but Notion regularly updates their API. Try using the latest version, which you can find in their API documentation.
Another potential culprit could be the axios configuration. Instead of passing the headers in the second argument of the post method, try setting them separately:
If that doesn’t work, double-check that your database ID is correct. It should be a 32-character string, not the full URL. You can find it in the database URL after the last slash and before the question mark.
Lastly, ensure you’re not hitting any rate limits. Notion has some pretty strict limits, especially for free accounts. If you’re making multiple requests in quick succession, try adding a delay between them.
yo dude, i had the same prob! turned out my database ID was wrong. double check it’s the long string in the URL when u open ur database in notion. also, make sure ur using the right version number in the headers. good luck man!