Updated: · Automation Notes admin

Notion API object_not_found (404): What to Check First

You try to read a page via the Notion API from a script, only to get an error saying it wasn't found. The ID was copied straight from the URL, and the token works on other pages. Yet for some reason, it returns a 404.

I hit this exact wall myself when I reused a token that was already working for a new purpose. Because it ran automatically, it quietly kept failing for days before I even noticed the error. This article outlines the troubleshooting checklist to follow when you get a 404.

What 404 (object_not_found) Means

According to the official Notion documentation, this error means that from the perspective of the token used, the resource does not exist. It also notes that this can indicate the resource has not been shared with the token's owner. The error message includes a line like this:

"code": "object_not_found",
"message": "… Make sure the relevant pages and databases are shared with your connection."

In other words, 404 doesn't just mean "it doesn't exist"—it also means "it isn't visible to your API key." In practice, it's almost always the latter.

Steps to Check When You Get a 404

  1. 1. ConnectionDid you use "Add connections" on the page (or its parent)?
  2. 2. ID TypeDid you mistake it for a view ID or data source ID?
  3. 3. Original DatabaseDid you also share linked databases and relation targets?
Arranged in the easiest order to check, based on Notion's official documentation.

The Most Common Cause: Missing "Add connections" on the Page

Simply creating an API integration (connection) does not grant it access to any pages. The official documentation explains that before an integration can interact with a page, that page must be manually shared with the integration.

You can share a page in the Notion UI as follows (per the Notion Help Center):

  1. Open the target page and click "•••" in the top right.
  2. Click "Add connections" near the bottom of the menu.
  3. Search for and select the integration you are using.

Adding a connection to a parent page grants access to all pages nested under it as well. The official documentation confirms that granting access to a parent page provides access to all of its child pages. If you keep related pages—like household task trackers—under a single parent page and add the connection only to that parent, you won't need to reconfigure settings every time you create a new page.

This is where I got stuck. Because I reused an existing token, I assumed everything was already set up. But the new target page was under a different parent page and didn't have the connection added.

Other Causes

CauseHow to Check and Fix
Using a view IDThe value after "v=" in a database URL is the view ID, not the database ID. Use the 32 characters after the "/" and before the "?".
Confusing a database ID with a data source IDIn API version 2025-09-03 and later, databases and data sources have separate IDs. The official documentation explains that they cannot be used interchangeably.
Sharing a linked databaseSharing a database that is merely displayed on another page (a linked view) is not enough. Share the original database.
Related databasesTo retrieve information from a database linked via a relation property, that target database must also be shared.

To see which part of a URL is the ID, you can paste the URL into the Notion ID Finder. It clearly distinguishes page and database IDs from view IDs.

Differences from 401 and 403

Similar errors include 401 and 403. The official documentation explains them as follows:

StatusCodeMeaning
401unauthorizedThe token is invalid (e.g., copied incorrectly or still using an outdated token).
403restricted_resourceThe token lacks required permissions, or the workspace has reached its block limit.
404object_not_foundThe resource does not exist from the token's perspective, or has not been shared.

Troubleshooting is much faster if you remember the rule of thumb: check the token for 401, check integration permissions for 403, and check connections first for 404.

Preventing Silent Failures

In automated scripts, treating a 404 the same as "no data found" means failures can go unnoticed for days. I prevent this with two practices:

Summary

You can also interact with Notion from Claude Code using your own user permissions without an API token. See Connect Claude Code to Notion: Setting Up Notion MCP.