## TL;DR
Notion integrations only see pages and databases explicitly shared with them. object_not_found means the database id is wrong, or the database was never shared with your integration. The Notion UI shows you everything; the API shows you only what's shared. Share the database with the integration, then retry with the exact id.

## The query

```text
notion api object_not_found on database query
```

## Use this when

- Database queries fail with object_not_found
- The database opens in Notion but fails through the API
- Queries fail after a workspace or permission change


## Not for

- Notion authentication errors
- Property validation errors on writes
- Notion rate limits


## Steps

### 1. Share the database with the integration

In Notion, open the database, go to its connections or share settings, and add your integration. This is the fix in most cases. Until shared, the API behaves as if the database doesn't exist.

Expected output: the integration listed on the database's connections.

### 2. Copy the database id from the URL

The id is the 32-character hex string in the database's URL. Copy it exactly, watching for URL encoding or truncation. A wrong id gives the same error as an unshared database.

Expected output: the exact database id from the URL.

### 3. Distinguish wrong-id from unshared

After sharing, retry. If it still fails, the id is wrong; if it succeeds, sharing was the issue. Change one thing at a time so you know which fixed it.

Expected output: a clear verdict: sharing fixed it, or the id was wrong.

### 4. Re-share after moves and duplicates

Moving a database, duplicating it, or changing workspaces creates a new object that isn't shared. Every new copy needs sharing again. Automate a check if your workflow creates databases often.

Expected output: a process that shares new databases with the integration.

## Variant phrasings

### notion integration database not found

Step 1's sharing fix; it's the cause almost every time.

### notion api could not find database

Step 2's id check for the remainder.

## Why it happens

Notion's sharing model is per-object and explicit: integrations start blind and gain visibility one share at a time. The UI never hints at this because you, the human, can see everything. So the API's 'not found' reads as a bug when it's actually the permission model working as designed.

## Edge cases

- Parent pages don't confer access. Sharing a page doesn't share its databases.
- Integration capabilities (read vs write) are set at creation. A read-only integration can't write even to shared databases.
- Database ids change on duplication. Never reuse an id after duplicating.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_dXfi5WZbLx8SqHU4eEdbSw
