---
sidebar_position: 9
title: Notion Integration
---

# Notion Integration

Connect a Notion workspace so your agents can read and write pages and databases — for example, publishing a rich digest as Notion blocks. Notion uses **OAuth** (workspace install).

## How It Works

You authorize Zibby against a Notion workspace via OAuth. Notion returns a long-lived bearer token (no refresh, no expiry) scoped to the pages and databases you grant. Zibby stores it encrypted with the workspace metadata. The report renderer then publishes structured digests as native Notion blocks.

## Connect Notion

1. In the Zibby dashboard, go to **Settings → Integrations** and click **Connect** next to Notion
2. You're redirected to Notion to authorize Zibby
3. Select which pages/databases Zibby may access
4. You're redirected back to Zibby — the card shows the connected workspace

## What Agents Can Do

Agents can render a `report` object straight to Notion blocks (`reportToNotionBlocks`) and publish it to a connected page or database — the same digest you can route to Slack or Lark. The `notify-notion` template is the shipped example.

## Reference key (SDK / CLI)

When running agents directly, the connector reads `NOTION_API_KEY` from the environment (a Notion internal-integration token works for the SDK path).

## Troubleshooting

**Agent can't see a page** — Notion access is page-scoped. Re-run the OAuth flow and grant the specific page/database, or share it with the integration from Notion's UI.

**Write fails** — confirm the granted pages include write access; read-only grants can't create blocks.
