Agent skill

notion

Create, search, and update Notion pages/databases using the Notion API. Use for documenting work, generating runbooks, and automating knowledge base updates.

Stars 78
Forks 21

Install this agent skill to your Project

npx add-skill https://github.com/OpenHands/extensions/tree/main/skills/notion

SKILL.md

Notion

bash
[ -n "$NOTION_INTEGRATION_KEY" ] && echo "NOTION_INTEGRATION_KEY is set" || echo "NOTION_INTEGRATION_KEY is NOT set"

If it’s missing, ask the user to provide it (or connect a Notion integration) before proceeding:

  • NOTION_INTEGRATION_KEY: Notion integration secret (starts with ntn_...)

Also confirm the integration has been shared with the target page/database in Notion. </IMPORTANT>

Base headers

bash
-H "Authorization: Bearer ${NOTION_INTEGRATION_KEY}" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json"

Find a page (search)

Use Notion’s search endpoint to find a page by title.

bash
curl -s https://api.notion.com/v1/search \
  -H "Authorization: Bearer ${NOTION_INTEGRATION_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "OpenHands Wiki",
    "page_size": 10
  }' | jq .

Create a page under a parent page

bash
PARENT_PAGE_ID="<parent_page_id>"

curl -s https://api.notion.com/v1/pages \
  -H "Authorization: Bearer ${NOTION_INTEGRATION_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{
    "parent": {"type": "page_id", "page_id": "'"${PARENT_PAGE_ID}"'"},
    "properties": {
      "title": {
        "title": [{"type": "text", "text": {"content": "My new page"}}]
      }
    },
    "children": [
      {
        "object": "block",
        "type": "paragraph",
        "paragraph": {
          "rich_text": [{"type": "text", "text": {"content": "Hello from OpenHands."}}]
        }
      }
    ]
  }' | jq .

Append blocks to an existing page

Use the page’s block id (same as page id) to append children.

bash
PAGE_ID="<page_id>"

curl -s -X PATCH "https://api.notion.com/v1/blocks/${PAGE_ID}/children" \
  -H "Authorization: Bearer ${NOTION_INTEGRATION_KEY}" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{
    "children": [
      {
        "object": "block",
        "type": "heading_2",
        "heading_2": {"rich_text": [{"type": "text", "text": {"content": "Appended section"}}]}
      }
    ]
  }' | jq .

Tips / gotchas

  • Sharing is required: even with a valid key, the integration can’t see a page/database until it has been shared with the integration in the Notion UI.
  • Rate limits: keep requests small; for large pages, create the page first and then append blocks in batches.
  • IDs format: Notion IDs may be returned with dashes; both dashed and non-dashed forms typically work in API calls.

Documentation

Expand your agent's capabilities with these related and highly-rated skills.

OpenHands/extensions

releasenotes

Generate formatted changelogs from git history since the last release tag. Use when preparing release notes that categorize changes into breaking changes, features, fixes, and other sections.

78 21
Explore
OpenHands/extensions

bitbucket

Interact with Bitbucket repositories and pull requests using the BITBUCKET_TOKEN environment variable. Use when working with code hosted on Bitbucket or managing Bitbucket resources via API.

78 21
Explore
OpenHands/extensions

add-skill

Add an external skill from a GitHub repository to the current workspace. Use when users want to import, install, or add a skill from a GitHub URL (e.g., `/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview` or "add the codereview skill from https://github.com/OpenHands/extensions/"). Handles fetching the skill files and placing them in .agents/skills/.

78 21
Explore
OpenHands/extensions

add-javadoc

Add comprehensive JavaDoc documentation to Java classes and methods. Use when documenting Java code, adding API documentation, or improving code documentation.

78 21
Explore
OpenHands/extensions

flarglebargle

A test skill that responds to the magic word "flarglebargle" with a compliment. Use for testing skill activation and trigger functionality.

78 21
Explore
OpenHands/extensions

codereview-roasted

Brutally honest code review in the style of Linus Torvalds, focusing on data structures, simplicity, and pragmatism. Use when you want critical, no-nonsense feedback that prioritizes engineering fundamentals over style preferences.

78 21
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results