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

# Notion integration

[Back to list of integrations](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems.md)

Use the Notion integration to let agents create, update, find, and archive database items, create and append to pages, and read or add comments through Action Tools.

| Authentication | Actions | Workflow triggers |
| - | - | - |
| OAuth 2.0 | [13](#supported-actions) | [4](#workflow-triggers) |

## Supported actions

Actions are Notion operations that an agent runs as Action Tools during a conversation. You can also run them from an [Integration node](https://koreai.mintlify.site/agent-platform/workflows.md#integration-node) in a workflow.

| Group | Actions |
| - | - |
| Databases | [Create Database Item](#create-database-item), [Update Database Item](#update-database-item), [Find Database Item](#find-database-item), [Archive Database Item](#archive-database-item), [Restore Database Item](#restore-database-item), [Retrieve Database Structure](#retrieve-database-structure) |
| Pages | [Create Page](#create-page), [Append to Page](#append-to-page), [Get block content](#get-block-content), [Find Page](#find-page) |
| Comments | [Add Comment](#add-comment), [Get Page Comments](#get-page-comments) |
| Advanced | [Custom API Call](#custom-api-call) |

## Workflow triggers

Triggers are Notion events that start a workflow automatically. Select them as [app triggers](https://koreai.mintlify.site/agent-platform/workflows.md#app-triggers) when you configure a workflow.

| Trigger | Fires when |
| - | - |
| New Database Item | An item is added to a database. |
| Updated Database Item | An item in a database is updated. |
| New Comment | A comment is added to a specific page. |
| Updated Page | A page in the workspace is updated. |

## Prerequisites

* A Notion workspace where you can create integrations.
* The Notion pages and databases shared with the integration during authorization. The agent can access only what you share.

## Set up the integration

**1. Create a Notion public integration**

In [Notion integrations](https://www.notion.so/profile/integrations), create a **Public** integration, add the Artemis **Callback URL** as a redirect URI, and copy the **OAuth client ID** and **OAuth client secret**. See [Authorization](https://developers.notion.com/docs/authorization).

**2. Create the auth profile**

In **Integrations**, select **Notion** > **Connect**. On **Project Auth Profiles**, select **New Profile** > **Integration Profile** > **Notion** > **Continue**. Enter the **Client ID** and **Client Secret**, select **Create Profile**, and then select **Authorize**. In the Notion consent screen, select the pages to share. Artemis pre-fills the Notion endpoints and the `owner=user` parameter. Notion doesn't use scopes.

**Usage Mode**: **Preconfigured** shares one authorization across users; **JIT** and **Preflight** ask each user to authorize, during or before the session. See [Auth profiles](https://koreai.mintlify.site/agent-platform/administration/integrations-settings.md#auth-profiles).

**3. Create the action tool**

In **Tools**, select **New Tool** > **Action** > **Notion** > **Continue**. Select the **Action** and **Auth Profile**, set parameter defaults (leave a value empty for the agent to supply at runtime), and select **Create Tool**. Then [assign the tool to an agent](https://koreai.mintlify.site/agent-platform/tools/actions.md#assign-an-action-to-an-agent).

## Action reference

### Databases

> [accordion] Create Database Item
>
> | Parameter | Type | Description |
> | - | - | - |
> | `database_id` | enum | Database. |
> | `databaseFields` | object | Field values. |
> | `content` | string | Optional page content for the item. |

> [accordion] Update Database Item
>
> | Parameter | Type | Description |
> | - | - | - |
> | `database_id` | enum | Database. |
> | `database_item_id` | enum | Item to update. |
> | `databaseFields` | object | Field values to change. |

> [accordion] Find Database Item
>
> | Parameter | Type | Description |
> | - | - | - |
> | `database_id` | enum | Database. |
> | `filterDatabaseFields` | object | Field values to match. |

> [accordion] Archive Database Item
>
> Soft-deletes an item. You can restore it later.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `database_id` | enum | Database. |
> | `database_item_id` | enum | Item to archive. |

> [accordion] Restore Database Item
>
> | Parameter | Type | Description |
> | - | - | - |
> | `database_id` | enum | Database. |
> | `archived_item_id` | enum | Archived item to restore. |

> [accordion] Retrieve Database Structure
>
> Returns the database properties, field types, and configuration.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `database_id` | enum | Database. |

### Pages

> [accordion] Create Page
>
> Creates a sub-page under the selected page.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `pageId` | enum | Page. The list shows your 100 most recent pages. |
> | `title` | string | Page title. |
> | `content` | string | Page content. |

> [accordion] Append to Page
>
> | Parameter | Type | Description |
> | - | - | - |
> | `pageId` | enum | Page. The list shows your 100 most recent pages. |
> | `content` | string | Content to append. Supports Markdown. |

> [accordion] Get block content
>
> Returns a page's content as blocks.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `parentId` | string | Page or parent block ID. |
> | `markdown` | boolean | Converts blocks to Markdown. Default: `False`. |
> | `dynamic` | object | Dynamic properties. |

> [accordion] Find Page
>
> | Parameter | Type | Description |
> | - | - | - |
> | `title` | string | Full or partial page title. |
> | `exact_match` | boolean | Requires an exact title match. Default: `False`. |
> | `limit` | number | Maximum results, from 1 to 100. |

### Comments

> [accordion] Add Comment
>
> | Parameter | Type | Description |
> | - | - | - |
> | `page_id` | enum | Page. |
> | `comment_text` | string | Comment text, posted as a new comment. |

> [accordion] Get Page Comments
>
> Returns comments grouped by discussion thread.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `page_id` | enum | Page. |

### Advanced

> [accordion] Custom API Call
>
> | Parameter | Type | Description |
> | - | - | - |
> | `url` | object | Endpoint URL. |
> | `method` | enum | HTTP method. |
> | `headers` | object | Additional request headers. Artemis injects the authorization header. |
> | `queryParams` | object | Query parameters. |
> | `body_type` | enum | Body type. Default: `None`. |
> | `body` | object | Request body. |
> | `response_is_binary` | boolean | Turn on for binary responses. Default: `False`. |
> | `failsafe` | boolean | Returns no error when the call fails. |
> | `timeout` | number | Timeout, in seconds. |
> | `followRedirects` | boolean | Follows HTTP redirects. Default: `False`. |

## Troubleshoot common issues

| Issue | Resolution |
| - | - |
| `redirect_uri` error during authorization | Add the exact **Callback URL** to the integration's redirect URIs. |
| Database or page lists are empty | Share the pages or databases with the integration. Authorize again and select them, or use **Connections** on the page in Notion. |
| `object_not_found` | The integration can't access the page or database. Share it with the integration. |
| Field values are rejected | Use **Retrieve Database Structure** to check field names and types. |

**Related articles:**

* [Auth profiles](https://koreai.mintlify.site/agent-platform/administration/integrations-settings.md#auth-profiles)
* [Action Tools](https://koreai.mintlify.site/agent-platform/tools/actions.md)
* [Notion API](https://developers.notion.com/reference/intro)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.