Connecting an AI Agent to Notion, Method and Mistakes
After the messaging series, I moved to productivity. First up is Notion. Attaching Notion to an agent lets you handle "summarize this document" requests without opening a browser. Setup takes about 10 minutes — once you know why it fails, you can fix it quickly. (measured on the operator's environment)
1. Creating an internal integration
Notion workspace settings → Connections → + New integration → give it a name → select the workspace → submit.
You get an Internal Integration Secret token. This is the only credential you need.
secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2. Sharing pages with the integration
This is where most people get stuck. Creating the integration is not enough — you must explicitly share pages with it.
Open the page → ••• (top right) → Connections → find your integration name → add it.
Trap 1: Without page sharing, every API call returns "object_not_found"
The integration exists, the token works, but the page is invisible to it. This is the single most common Notion integration failure.
Trap 2: Share at the top-level page, not individual children
If you only share a child page, the integration cannot see its parent. Share the root page of the workspace or the highest-level page you want to access.
3. Reading pages via the API
curl -X GET https://api.notion.com/v1/pages/{page_id} \
-H "Authorization: Bearer secret_xxx" \
-H "Notion-Version: 2022-06-28"
The page ID comes from the URL: notion.so/{page_id} — the long string after the workspace name.
4. What Notion is actually good for
Notion is the best "knowledge base" channel for agents. You can have the agent read meeting notes, summarize project pages, or search across the workspace. Unlike messaging apps, Notion is persistent — the agent can read yesterday's notes without you pasting them again.
Summary
- Create an internal integration → get the secret token
- Share pages with the integration (this is the step everyone skips)
- Share at the top-level page, not individual children
- Use the Notion-Version header (2022-06-28 is current)
- Notion is the best persistent knowledge base for agents
AI Knowledge Hub
Comments (2)
I also got stuck in two places while wiring up Notion. One was page permissions, the other was the property value format.
On permissions, if sharing doesn't work no matter how much you click, first check whether the read/write permission checkbox under the Integration settings' capabilities is checked. The default is read-only, so no matter how much permission you grant, writes are blocked. File upload is a separate problem that comes next. Text properties just go in, but file properties must be passed as base64 rather than a URL and are capped at 20MB. Throwing a PDF in directly gets truncated and fails silently.
In short, Notion feels harder because the permissions UI isn't documented. Checking the Integration capabilities first can save you half a day.
Show 1 more comments
One thing to add on connecting Notion. The Notion API has a rate limit of 3 requests per second. Repeated bulk page creation or database row insertion frequently triggers 429 Too Many Requests. For webhooks or high-frequency work, I'd recommend using a request-pool pattern or spacing calls at least 300ms apart.