> ## Documentation Index
> Fetch the complete documentation index at: https://cofounder.appeeky.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Notion

> Sync every report to a Notion database for searchable history.

The Notion integration creates a new page in your chosen Notion database after every successful run. Use it to build a searchable archive, embed in your team's workspace, or browse historical briefings on mobile.

## Two setup options

| Option                   | Setup time                                     |
| ------------------------ | ---------------------------------------------- |
| **OAuth** ⭐              | 30 sec — workspace name captured automatically |
| **Internal Integration** | 5 min                                          |

> See [OAuth (recommended)](./oauth) for the cross-provider flow overview.

***

## Option A — OAuth (one click)

```
GET /v1/cofounder/oauth/notion/start?return_to=<your-page>
   →  { authorizeUrl, state }
```

After consent the agent stores the access token, captures the workspace name, and the bot id. **You still need to**:

1. Open the Notion database you want briefings in.
2. Click *...* (top-right) → *Add connections* → pick your "App Co-founder" integration.
3. Save the database id:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X PUT https://api.appeeky.com/v1/cofounder/integrations/notion \
  -H "X-API-Key: $APPEEKY_KEY" \
  -d '{ "integrationConfig": { "databaseId": "abc123..." } }'
```

Enable in preferences:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
PUT /v1/cofounder/preferences { "enabledIntegrations": ["notion"] }
```

***

## Option B — Internal Integration (manual)

### 1. Create a Notion integration

* [https://www.notion.so/profile/integrations](https://www.notion.so/profile/integrations) → *New integration*
* Name it (e.g., "App Co-founder")
* Workspace: pick yours
* Type: **Internal**
* Capabilities: keep defaults (Read, Update, Insert content)
* Copy the **Internal Integration Token** (starts with `secret_`)

### 2. Create a database

In Notion, create a new database (Full page database is easiest). Recommended properties:

| Property   | Type  | Notes                                |
| ---------- | ----- | ------------------------------------ |
| `Name`     | Title | Required (used as page title)        |
| `App`      | Text  | Auto-filled with the app ID          |
| `Headline` | Text  | Auto-filled with the report headline |
| `Date`     | Date  | Auto-filled with publication date    |

You can add more properties (multi-select tags, status) — they'll just stay empty.

### 3. Share the database with your integration

In your database page → top-right **... menu** → *Add connections* → pick your integration.

### 4. Find the database ID

Open the database as a full page. The URL looks like:

```
https://www.notion.so/<workspace>/<database_id>?v=<view_id>
```

Copy the `<database_id>` (32-char hex, typically with dashes).

## Save credentials

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X PUT https://api.appeeky.com/v1/cofounder/integrations/notion \
  -H "X-API-Key: $APPEEKY_KEY" \
  -d '{
    "credentials": { "token": "secret_..." },
    "integrationConfig": { "databaseId": "abc123..." }
  }'
```

The integration is tested before saving — `users/me` confirms the token, `databases/<id>` confirms access.

## Enable

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
PUT /v1/cofounder/preferences
{ "enabledIntegrations": ["notion"] }
```

## What gets created

Every successful run creates one Notion page:

* **Title** — `2026-05-02 — <report headline>`
* **Properties** — `App`, `Headline`, `Date` populated automatically
* **Body** — the briefing markdown converted to Notion blocks (headings, bullet lists, paragraphs)

The agent uses `briefingMarkdown` if present, otherwise a Slack-style report summary.

## Tips

* Add a **Status** select property and use Notion automations to mark briefings as "read" / "archived"
* Build a Notion board view grouped by `App` to see one column per app
* Filter by `Date` to make rolling weekly digests
* Combine with Notion's mobile app for offline reading

## Disable

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
PUT /v1/cofounder/preferences { "enabledIntegrations": [] }
```

(remove `"notion"`). Or fully remove credentials:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
DELETE /v1/cofounder/integrations/notion
```
