Install
openclaw skills install notion-api-automationManage Notion notes, pages, and data sources with a JSON-first CLI for search, read/export, write/import, append, and move operations. Use when working with Notion, organising notes, moving pages, triaging an inbox, or reading/writing page content.
openclaw skills install notion-api-automationPrefer deterministic scripts over ad‑hoc API calls:
This skill ships a single entrypoint CLI: {baseDir}/scripts/notionctl.mjs.
Notion-Version: 2025-09-03 for every request.Retry-After.data_source_id, not database_id.This skill expects NOTION_API_KEY to be present in the environment.
If you need a fallback for local dev, the CLI also checks:
NOTION_TOKEN, NOTION_API_TOKEN~/.config/notion/api_keynode {baseDir}/scripts/notionctl.mjs whoami
Search pages (title match):
node {baseDir}/scripts/notionctl.mjs search --query "meeting notes" --type page
Search data sources (title match is against the database container title in 2025-09-03):
node {baseDir}/scripts/notionctl.mjs search --query "Inbox" --type data_source
node {baseDir}/scripts/notionctl.mjs export-md --page "<page-id-or-url>"
Under a parent page:
node {baseDir}/scripts/notionctl.mjs create-md --parent-page "<page-id-or-url>" --title "Idea" --md "# Idea\n\nWrite it up..."
Under a data source (database row):
node {baseDir}/scripts/notionctl.mjs create-md --parent-data-source "<data-source-id-or-url>" --title "Idea" --md "# Idea\n\nWrite it up..."
Optional: set properties when parent is a data source:
node {baseDir}/scripts/notionctl.mjs create-md \
--parent-data-source "<data-source-id>" \
--title "Inbox: call plumber" \
--md "- [ ] Call plumber\n- [ ] Ask for quote" \
--set "Status=Inbox" --set "Tags=home,admin" --set "Due=2026-02-03"
node {baseDir}/scripts/notionctl.mjs append-md --page "<page-id-or-url>" --md "## Update\n\nAdded more detail."
Move under another page:
node {baseDir}/scripts/notionctl.mjs move --page "<page-id-or-url>" --to-page "<parent-page-id-or-url>"
Move into a database (data source):
node {baseDir}/scripts/notionctl.mjs move --page "<page-id-or-url>" --to-data-source "<data-source-id-or-url>"
create-md with --parent-data-source or --parent-page.If your inbox is a page with child pages:
node {baseDir}/scripts/notionctl.mjs list-child-pages --page "<inbox-page-id-or-url>"
node {baseDir}/scripts/notionctl.mjs triage --inbox-page "<inbox-page-id>" --rules "{baseDir}/assets/triage-rules.example.json"
node {baseDir}/scripts/notionctl.mjs triage --inbox-page "<inbox-page-id>" --rules "{baseDir}/assets/triage-rules.example.json" --apply
export-md to read contentappend-md / create-md / move--dry-run or omit --apply, cap scope with --limit, and only then apply.Retry-After; reduce concurrency.