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

# Notion Integration

> Connect HelloLeo to your Notion workspace

Connect HelloLeo to your Notion workspace to read and write pages, databases, and content.

## Setup

1. Go to **Project Settings** → **Project Integrations**
2. Select **Notion** from the list
3. Enter your credentials:
   * **Integration Secret** - Your Notion internal integration secret
     * Get it from [Notion Integration Setup](https://github.com/makenotion/notion-mcp-server?tab=readme-ov-file#installation)
4. Test the connection
5. Start using Notion in your prompts

## How It Works

HelloLeo uses the Notion API through the Integration Proxy. Your integration secret is encrypted and stored securely on the backend. API calls are made directly from your frontend through the proxy, avoiding CORS issues.

## API Endpoints

The integration uses Notion's REST API (version 2022-06-28). Common endpoints include:

* `/v1/pages/{page_id}` - Access individual pages
* `/v1/databases/{database_id}/query` - Query databases
* `/v1/databases/{database_id}` - Get database information
* `/v1/blocks/{block_id}/children` - Get block children

## Common Operations

### Read Pages

* **GET** `/v1/pages/{page_id}` - Get page content and properties

### Query Databases

* **POST** `/v1/databases/{database_id}/query` - Query database records

### Create Pages

* **POST** `/v1/pages` - Create a new page

### Update Pages

* **PATCH** `/v1/pages/{page_id}` - Update page properties or content

### Get Database Info

* **GET** `/v1/databases/{database_id}` - Get database schema and properties

## Example Usage

### Display Pages

```
Show all pages from my Notion database "Projects". 
Display title, status, and last edited date.
```

### Display Page Content

```
Show the content from the Notion page titled "Getting Started".
```

### Create a Page

```
Create a new page in Notion with title "Meeting Notes" 
and content "Discussion about project roadmap".
```

### Query Database

```
Find all pages in my Notion "Tasks" database where status 
is "In Progress".
```

## Best Practices

* **Specify database or page** - Always mention which Notion database or page you're working with
* **Use page titles** - Reference pages by their titles when possible
* **Mention the integration** - Always say "from Notion" or "to Notion" so Leo knows which integration to use
* **Grant access** - Make sure your Notion integration has access to the pages and databases you want to use

## Troubleshooting

### Connection Issues

* **Check integration secret** - Verify your Notion integration secret is correct
* **Integration access** - Ensure your integration has been granted access to the pages/databases you need
* **API version** - The integration uses Notion API version 2022-06-28

### Data Not Showing

* **Check page/database ID** - Verify you're using the correct page or database ID
* **Permissions** - Ensure your integration has read access
* **Page sharing** - Make sure pages are shared with your integration

### Can't Create/Update

* **Write permissions** - Ensure your integration has write access
* **Page parent** - When creating pages, specify the correct parent page or database
* **Property types** - Check that property values match the expected types

<CardGroup cols={2}>
  <Card title="Working with Integrations" icon="plug" href="/integrations/working-with-integrations">
    Learn how to use integrations effectively
  </Card>

  <Card title="Network Monitor" icon="activity" href="/features/network-monitor">
    Debug Notion API calls
  </Card>
</CardGroup>
