The Data Source, Not the Database.

Notion splits every database into a container and a separate data source that holds the schema and rows. The video explains which ID Claude needs, why requests fail without a version header, and what a 404 usually means.

2:25 video3 min readWatch on YouTube

Someone setting up Claude with Notion might assume it only needs a database's ID to run a query. The video explains why that fails. Notion splits every database into a container and a separate data source underneath it, and the queries Claude runs need the data source ID instead. The video also covers two smaller traps that tend to show up alongside it.

One database, two IDs

Every Notion database has a data source beneath it, and that data source is where the real table lives: its schema and every row. A row is simply a page whose parent is that data source. As a result, schema reads, queries and creating a new row all need the data source ID, not the database ID. Use the wrong one and you are told the object does not exist. The video clarifies that the database ID is not useless: it is what you retrieve first, so you can read its list of data sources and find the ID that matters.

Two bundled scripts

The skill described includes two scripts for common work. One searches the workspace and pages through every result. The other reads a full page block by block, in the order you would read it.

Missing version and missing share

Two details trip people up. First, every request needs a specific version header. Leave it off, and every call fails immediately with a missing version error, before Notion even looks at what was asked. Second, when a search or read comes back empty or says an object was not found, that is almost never a bad ID. It almost always means the page or database has not been shared with Claude's connection. The advice is to check sharing before second-guessing the ID.

Listed, not opened

The video lists a few easy-to-miss behaviors.

  • The page-reading script lists a nested subpage or subdatabase when it finds one, but does not open it. That needs its own separate read.
  • A file link inside a block, such as an image, stops working after about an hour, so it should not be saved and reused.
  • When a result list has more pages, the code fetching them has to watch for an error coming back midstream, or the loop can run forever.
  • Filtering depends on the property's type: select takes equals, multi-select takes contains, and date takes before or after. Reading the schema first is the only way to know which applies.

Key takeaways

  • A Notion database is a container; the schema and rows live in its data source, which has its own ID.
  • Schema reads, queries and new rows need the data source ID.
  • Retrieve the database first to find the data source in its list.
  • Every request needs a specific version header or it fails immediately.
  • An empty result or "not found" usually means the page was not shared with Claude's connection.
  • Nested subpages are listed but not opened, and file links expire after about an hour.
  • Read the schema before filtering, because the right condition depends on property type.

Try it yourself

Run the video's prompt on your own Notion workspace: ask Claude to search for pages about onboarding, read the most recently updated match and summarize it in its own words. If reaching that page means querying a database, ask Claude to say aloud whether it is using the database's ID or the data source ID underneath it.

Chapters

  1. 0:00The naive framing: "Claude just needs the database ID"
  2. 0:12One database, two IDs
  3. 0:46Missing version, missing share
  4. 1:10Listed, not opened
  5. 1:47Carry-out
  6. 2:01Your turn
  7. 2:21Outro
Full transcript(auto-generated, with timestamps)

The naive framing: "Claude just needs the database ID"

[0:00]Someone assumes Claude just needs a database's ID to run a query. It doesn't Notion splits every database into a separate data source, and queries need that ID instead. So, what's the difference? Notion doesn't let Claude query a

One database, two IDs

[0:13]Database directly. Every database has its own data source underneath it, and that data source is where the real table lies, its schema, and every row in it. A row is just a page whose parent happens to be that data source. So, schema reads, queries, and creating a new row all need the data source ID, not the database ID. Get that wrong, and you'll be told the object doesn't exist. Two bundled scripts handle the common work: Notion search, sh searches your workspace, and pages through every result. Notion read page, sh reads a full page block by block in the order you'd read it. Two details trip people

Missing version, missing share

[0:46]Up. First, every request needs a specific version header. Leave it off, and every single call fails immediately with a missing version error before Notion even looks at what you asked for. Second, when a search or a read comes back empty or says the object wasn't found, that's almost never a bad ID. It almost always means the page or database hasn't been shared with Claude's connection yet. Check sharing before you start second-guessing the ID. A few things are easy to miss. The page

Listed, not opened

[1:11]Reading script lists a nested subpage or subdatabase when it finds one, but it doesn't open it. That needs its own separate read. Any file link inside a block, like an image, stops working after about an hour, so it's never something to save and reuse. When a result list has more pages, the code fetching them has to watch for an error coming back midstream, or the loop can run forever instead of stopping. And filtering a database isn't one-size-fits-all. The right condition depends on the property's type. Select takes equals, multi-select takes contains, date takes before or after. Reading the schema first isn't optional. It's the only way to know which one applies. Claude doesn't query a Notion

Carry-out

[1:47]Database directly. It queries the data source underneath it, and needs that ID, not the database's. And when something can't be found, that almost always means it hasn't been shared with Claude yet, not that the idea is wrong. Your turn. Here's the prompt. Read it

Your turn

[2:02]With me. Search my Notion workspace for pages about onboarding, then read the most recently updated match and summarize it for me in your own words. If reaching that page means querying a database along the way, tell me out loud whether you're using the database's own ID or the data source ID underneath it. Lay 'em in for bear. The data source, not the database. Lay

Outro

[2:21]'em in for bear.

More from Claude Basics

Humanitarians AI Lyrical Literacy Project