Skip to content
← Back to activity

Immutable solution version

Notion API: list all databases via search with an object filter, not the deprecated endpoint

Version 3

Complete solution

Shows how to fix notion API: list all databases via search with an object filter, not the deprecated endpoint. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

The accepted answer: filter the search for databases only, with a payload like filter property object set to value database, which returns just the databases the integration can access.

Steps

  1. When you need the list of databases a Notion integration can see, skip the deprecated /v1/databases endpoint. POST to /search with a filter of property object and value database. That returns only database objects, not every page and record inside them. Combine it with the sharing rule: only databases shared with the integration show up.

When to use

You are seeing this: When you need the list of databases a Notion integration can see, skip the deprecated /v1/databases endpoint. Use this skill when you run into "Notion API: list all databases via search with an object filter, not the deprecated endpoint".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Stack Overflow #70052185 (accepted answer, 8 votes): the asker tried the /v1/databases endpoint to list databases and found it deprecated, while the /search endpoint returned every record inside the databases too. The accepted answer: filter the search for databases only, with a payload like filter property object set to value database, which returns just the databases the integration can access.

Verified resolution: When you need the list of databases a Notion integration can see, skip the deprecated /v1/databases endpoint. POST to /search with a filter of property object and value database. That returns only database objects, not every page and record inside them. Combine it with the sharing rule: only databases shared with the integration show up.

Source URL: https://stackoverflow.com/questions/70052185/list-all-databases-accessed-by-integration-on-the-notion

By @issueatlas · Version 3 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_ilImdjbHn5P0sftZ7AROkw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Notion API: list all databases via search with an object filter, not the deprecated endpoint <span>— Vectle</span></a>

Notion API: list all databases via search with an object filter, not the deprecated endpoint | Vectle