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

# Notion

> Automate a Notion Workspace

## Overview

The Notion tools allow you to automate various tasks related to Notion workspaces, including creating and managing pages, databases, and blocks. You can also extract information from Notion pages and databases.

## Key Features

* `NOTION_SEARCH`
  * Search pages and data sources shared with the connection by title, with optional result type filtering, last-edited sorting, and pagination.
* `NOTION_CREATE_PAGE`
  * Create a new page in a specified Notion workspace.
* `NOTION_CREATE_DATABASE_ITEM`
  * Create a new item in a specified Notion database.
* `NOTION_RETRIEVE_A_PAGE`
  * Retrieve a page from a specified Notion workspace.
* `NOTION_RETRIEVE_DATABASE`
  * Retrieve a database from a specified Notion workspace.
* `NOTION_QUERY_DATA_SOURCE`
  * Query a data source or legacy database with filters and sorts.
* `NOTION_LIST_BLOCK_CHILDREN`
  * Retrieve page or block children, with optional recursive traversal.
* `NOTION_APPEND_BLOCK_CHILDREN`
  * Append Notion block JSON to a page or block.
* `NOTION_DUPLICATE_PAGE`
  * Create a new page by copying writable page properties and recursively recreating supported child blocks (paragraphs, headings, lists, quotes, to-dos, toggles, callouts, synced blocks, equations, code, tables, columns, child pages, linked database views, and more). Unsupported content — such as Notion-hosted media reupload, link previews, buttons/forms, and full standalone database duplication — is skipped and reported in `skipped_blocks`.
* `NOTION_UPDATE_PAGE_PROPERTIES`
  * Update page properties, icon, cover, trash status, or lock state.
* `NOTION_APPEND_IMAGE_BLOCK`
  * Append an image block with an external URL or the File Upload API.

## Authentication

For further details, [click here](/en/pages/credentials/notion).

To use the Notion API, you need to create an integration in your Notion workspace. Follow these steps:

1. Go to [Notion Developers](https://www.notion.so/my-integrations).
2. Click on "New Integration".
3. Fill in the required details and select the workspace you want to connect.
4. After creating the integration, you will receive an "Internal Integration Token". This token is used to authenticate your requests to the Notion API.

**Note**: Treat API keys as sensitive information and never commit them to public repositories.

### Example: Create and Retrieve Pages and Databases

```yaml theme={null}
- id: retrieve_page
  tool: NOTION_RETRIEVE_A_PAGE
  config:
    - name: token
      value: "{{secrets.NOTION_TOKEN}}"
  input:
    - name: page_id
      value: 15cf9fcee23b81e193f7cb5774043b82
- id: retrieve_database
  tool: NOTION_RETRIEVE_DATABASE
  config:
    - name: token
      value: "{{secrets.NOTION_TOKEN}}"
  input:
    - name: database_id
      value: 16ff9fcee23b80d38b47d754dcaffe16
- id: create_page
  tool: NOTION_CREATE_PAGE
  config:
    - name: token
      value: "{{secrets.NOTION_TOKEN}}"
  input:
    - name: parent_page_id
      value: 196bf44b5f624485a29f415bf4afac47
    - name: title
      value: Test Page
    - name: content
      value: This is a test page
- id: create_database_item
  tool: NOTION_CREATE_DATABASE_ITEM
  config:
    - name: token
      value: "{{secrets.NOTION_TOKEN}}"
  input:
    - name: database_id
      value: 16ff9fcee23b80d38b47d754dcaffe16
    - name: title
      value: Test Page
    - name: content
      value: This is a test page
- id: search_notion
  tool: NOTION_SEARCH
  config:
    - name: token
      value: "{{secrets.NOTION_TOKEN}}"
  input:
    - name: query
      value: Meeting Notes
    - name: object_type
      value: page
    - name: sort_direction
      value: descending
- id: query_data_source
  tool: NOTION_QUERY_DATA_SOURCE
  config:
    - name: token
      value: "{{secrets.NOTION_TOKEN}}"
  input:
    - name: data_source_id
      value: 1a44be1209534631b4989e5817518db8
    - name: filter_json
      value: '{"property":"Done","checkbox":{"equals":true}}'
    - name: sorts_json
      value: '[{"property":"Date","direction":"descending"}]'
- id: duplicate_page
  tool: NOTION_DUPLICATE_PAGE
  config:
    - name: token
      value: "{{secrets.NOTION_TOKEN}}"
  input:
    - name: source_page_id
      value: 15cf9fcee23b81e193f7cb5774043b82
    - name: new_title
      value: Next Meeting
    - name: properties_json
      value: '{"Date":{"date":{"start":"2026-06-06"}}}'
- id: append_image
  tool: NOTION_APPEND_IMAGE_BLOCK
  config:
    - name: token
      value: "{{secrets.NOTION_TOKEN}}"
  input:
    - name: block_id
      value: 15cf9fcee23b81e193f7cb5774043b82
    - name: image
      value: https://example.com/graphic-recording.png
    - name: caption
      value: Graphic recording
```
