Skip to main content
RapidDev - Software Development Agency
openclaw-integrationsDirect API Integration

How to Connect Notion to OpenClaw

To connect Notion to OpenClaw, create a Notion integration at notion.so/my-integrations, copy the NOTION_API_KEY (Internal Integration Token), and share your target databases and pages with the integration. Configure the API key in OpenClaw's config file and OpenClaw can then read, create, and update Notion database entries and pages in real time. This is a direct API integration using Notion's official REST API — no ClawHub skill required.

What you'll learn

  • How to create a Notion Internal Integration and retrieve your NOTION_API_KEY
  • How to share Notion databases and pages with your integration to grant API access
  • How to configure the API key in OpenClaw's config for direct Notion integration
  • How to query, create, and update Notion database entries from OpenClaw
  • How to troubleshoot Notion permission errors and database property type mismatches
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate14 min read20 minutesNotes & DocumentsMarch 2026RapidDev Engineering Team
TL;DR

To connect Notion to OpenClaw, create a Notion integration at notion.so/my-integrations, copy the NOTION_API_KEY (Internal Integration Token), and share your target databases and pages with the integration. Configure the API key in OpenClaw's config file and OpenClaw can then read, create, and update Notion database entries and pages in real time. This is a direct API integration using Notion's official REST API — no ClawHub skill required.

Why Connect Notion to OpenClaw?

Notion has become the default knowledge management and project tracking tool for thousands of teams and individuals. Its flexible database system — where everything from a CRM to a task list to a content calendar can live as a Notion database — makes it an ideal data layer for AI automation. Connecting OpenClaw to Notion means your AI agent can read existing data from databases, create new entries based on events, update properties as tasks complete, and search your workspace for relevant information.

The practical use cases are broad. OpenClaw can sync tasks from external tools into a Notion task database, create meeting notes pages automatically when a calendar event ends, update a CRM database when customer interactions occur, maintain a running log of AI decisions and actions, or answer questions by searching your Notion workspace for relevant pages. Because Notion's database model is flexible, almost any structured data workflow can be expressed as operations on Notion databases.

Notion's API is clean and well-documented but has some quirks worth understanding upfront. The most important: access is opt-in at the page/database level. Creating an integration gives you an API key, but that key can only access pages and databases where the integration has been explicitly added as a connection (via the 'Connect to' menu in Notion). This is a deliberate security design — you must consciously grant access to each workspace section you want OpenClaw to reach.

Integration method

Direct API Integration

Notion's official API uses Internal Integration Tokens for server-to-server access. You create a Notion integration at notion.so/my-integrations, receive a secret key (NOTION_API_KEY), and share specific databases or pages with that integration directly in Notion's UI. OpenClaw then calls Notion's REST API endpoints to query databases, create pages, update properties, and search content using your API key. Unlike ClawHub skills, this is a direct HTTP API integration configured in OpenClaw's config file.

Prerequisites

  • A Notion account with at least one database you want to connect to OpenClaw
  • OpenClaw installed and running on your machine
  • The database ID for any Notion databases you want to access (found in the database URL)
  • Basic familiarity with REST APIs and JSON data structures
  • Understanding of Notion's database property types (title, text, select, date, etc.) for creating and updating entries

Step-by-step guide

1

Create a Notion Integration and Get Your API Key

Go to notion.so/my-integrations and click '+ New integration'. Give it a name (e.g., 'OpenClaw Integration') and select the workspace it should have access to. Under capabilities, select: - Read content - Update content - Insert content Click 'Submit'. Notion creates the integration and shows your Internal Integration Token — this is your NOTION_API_KEY. It looks like `secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. Copy it immediately. The token is the only credential you need for API access. Unlike OAuth integrations, Internal Integration Tokens do not expire and do not require periodic re-authorization. They are scoped to the workspace you selected and can only access pages and databases that you explicitly share with the integration. Do not confuse this with a Notion OAuth integration (used for third-party apps that need to access multiple users' workspaces). For OpenClaw connecting to your own workspace, the Internal Integration Token is the correct approach — simpler, no OAuth flow required.

terminal
1# Your Notion API key format:
2# NOTION_API_KEY=secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3
4# Verify API key works:
5curl -H "Authorization: Bearer YOUR_NOTION_API_KEY" \
6 -H "Notion-Version: 2022-06-28" \
7 https://api.notion.com/v1/users/me
8
9# Expected response:
10# {"object": "user", "id": "...", "type": "bot", "bot": {"owner": {"type": "workspace"}}}

Pro tip: If you accidentally expose your Notion API key, rotate it immediately: go to notion.so/my-integrations, click your integration, and click 'Regenerate' on the token. The old token becomes invalid immediately — update OpenClaw's config with the new token.

Expected result: Your Notion integration is created, your NOTION_API_KEY is copied, and the API verification call returns your bot user details.

2

Share Notion Databases and Pages with Your Integration

This is the most frequently missed step for Notion API beginners. Creating the integration and getting an API key is not enough — Notion requires you to explicitly grant the integration access to each database or page you want it to reach. For each database or page you want OpenClaw to access: 1. Open the database or page in Notion 2. Click the three-dot menu (⋯) in the top-right corner 3. Click 'Connect to' 4. Search for your integration name (e.g., 'OpenClaw Integration') 5. Click 'Confirm' You only need to share the top-level database or page — child pages inherit access automatically. If you have a workspace organized with a top-level 'Home' or 'Dashboard' page that contains all databases, sharing that one page with the integration gives access to everything under it. To find a database's ID (needed for API calls): open the database in Notion and look at the URL. The 32-character string after the last `/` (before `?v=`) is the database ID. Format: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` or `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` with hyphens.

terminal
1# Notion database URL format:
2# https://www.notion.so/workspace/DATABASE_ID?v=VIEW_ID
3# Example:
4# https://www.notion.so/myteam/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6?v=...
5# Database ID: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
6
7# Verify access to a database after sharing:
8curl -H "Authorization: Bearer YOUR_NOTION_API_KEY" \
9 -H "Notion-Version: 2022-06-28" \
10 https://api.notion.com/v1/databases/YOUR_DATABASE_ID
11
12# If access is not granted, you get:
13# {"object": "error", "status": 404, "code": "object_not_found"}

Pro tip: If you receive a 404 'object_not_found' error when querying a database you know exists, the integration has not been granted access to it. The database ID is correct but the integration cannot see it — go back to Notion and complete the 'Connect to' step for that specific database.

Expected result: The database verification call returns the database schema (properties list) rather than a 404 error, confirming the integration has been granted access.

3

Configure NOTION_API_KEY in OpenClaw

Open `~/.openclaw/config.yaml` and add the Notion integration block under `integrations`. The configuration requires your API key and optionally a default database ID for quick reference in workflows. The `version` field should always be set to `2022-06-28` — this is Notion's stable API version and must be included as a header on every API request. If omitted, requests may fail or return unexpected response formats. The optional `databases` section lets you give friendly names to specific database IDs, so you can reference them by name (e.g., `notion:task_log`) in OpenClaw workflows rather than using the raw 32-character ID. This makes workflows more readable and easier to maintain when database IDs need to change. After saving, run `clawhub reload`. OpenClaw will verify the API key and optionally pre-fetch the schema for each configured database to validate access.

~/.openclaw/config.yaml
1# ~/.openclaw/config.yaml
2integrations:
3 notion:
4 api_key: "secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
5 version: "2022-06-28" # Always use this Notion API version
6 databases:
7 task_log: "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" # Activity log DB
8 crm: "b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7" # CRM contacts DB
9 knowledge_base: "c3d4e5f6g7h8i9j0k1l2m3n4o5p6r8s9" # Docs database
10 default_database: task_log # Used when no database is specified in workflow
11 search_enabled: true # Enable full workspace search
12 page_size: 100 # Results per API call (max 100)

Pro tip: Use environment variable substitution for the API key: `api_key: "${NOTION_API_KEY}"` and export the variable in your shell profile. This keeps the secret out of the config file, which is especially important if you share your OpenClaw config across machines or teams.

Expected result: `clawhub reload` confirms the Notion API key is valid and lists the accessible databases from your config, showing their page counts.

4

Query and Create Notion Database Entries

With credentials configured, test querying an existing database and creating a new entry. Notion's API represents database entries as Pages — even rows in a database are internally Notion pages with properties. To query a database, POST to `/v1/databases/{database_id}/query` with optional filter and sort parameters. Notion's filter syntax uses a property-based structure — you specify which property to filter on and the condition. This is equivalent to adding a filter in Notion's database view. To create a new database entry (row), POST to `/v1/pages` with the parent database ID and a properties object matching the database schema. Property values must match the property type exactly — a Title property expects `{"title": [{"text": {"content": "value"}}]}` format, while a Select property expects `{"select": {"name": "option_name"}}`. Mismatched property types are the most common cause of failed page creation.

terminal
1# Query database entries (get last 5 tasks):
2curl -X POST "https://api.notion.com/v1/databases/YOUR_DATABASE_ID/query" \
3 -H "Authorization: Bearer YOUR_NOTION_API_KEY" \
4 -H "Notion-Version: 2022-06-28" \
5 -H "Content-Type: application/json" \
6 -d '{
7 "sorts": [{"property": "Created", "direction": "descending"}],
8 "page_size": 5
9 }'
10
11# Create a new database entry:
12curl -X POST "https://api.notion.com/v1/pages" \
13 -H "Authorization: Bearer YOUR_NOTION_API_KEY" \
14 -H "Notion-Version: 2022-06-28" \
15 -H "Content-Type: application/json" \
16 -d '{
17 "parent": {"database_id": "YOUR_DATABASE_ID"},
18 "properties": {
19 "Name": {
20 "title": [{"text": {"content": "OpenClaw workflow completed"}}]
21 },
22 "Status": {
23 "select": {"name": "Success"}
24 },
25 "Date": {
26 "date": {"start": "2026-03-30"}
27 },
28 "Notes": {
29 "rich_text": [{"text": {"content": "Automated entry from OpenClaw"}}]
30 }
31 }
32 }'

Pro tip: To see a database's exact property schema (property names and types), call `GET /v1/databases/{database_id}` and look at the `properties` object in the response. Property names in the API must match your database column names exactly, including capitalization.

Expected result: The database query returns a list of existing entries as JSON, and the create call returns a 200 response with the new page object — visible as a new row in your Notion database.

5

Build OpenClaw Workflows with Notion as Data Store

With CRUD operations working, integrate Notion into OpenClaw workflows as a persistent data store. The most powerful pattern is using Notion as a structured log and knowledge base — OpenClaw writes records as it operates, and you can query and analyze them in Notion's familiar interface. Configure OpenClaw workflows with Notion as the output target for activity logging. Every workflow completion, error, or notable event writes a structured entry to a Notion database. This gives you a searchable history of everything OpenClaw has done, viewable in Notion with custom views, filters, and groupings. For read workflows, search your Notion workspace before generating responses — this grounds AI outputs in your actual documentation rather than general knowledge. The Notion search API covers all accessible pages and databases. RapidDev's team recommends structuring your Notion activity log database with a consistent schema from the start: Name (title), Status (select), Integration (select), Timestamp (date), Summary (text), Error (text) — this schema accommodates virtually all OpenClaw activity types and supports rich Notion views.

~/.openclaw/config.yaml
1# ~/.openclaw/config.yaml Notion activity logging workflow
2workflows:
3 log-to-notion:
4 trigger:
5 type: workflow_complete # Fires after any other workflow completes
6 actions:
7 - type: integration-call
8 integration: notion
9 endpoint: /pages
10 method: POST
11 body:
12 parent:
13 database_id: "{{config.integrations.notion.databases.task_log}}"
14 properties:
15 Name:
16 title:
17 - text:
18 content: "{{trigger.workflow_name}} — {{trigger.status}}"
19 Status:
20 select:
21 name: "{{trigger.status}}"
22 Integration:
23 select:
24 name: "{{trigger.integration}}"
25 Timestamp:
26 date:
27 start: "{{trigger.completed_at}}"
28 Summary:
29 rich_text:
30 - text:
31 content: "{{trigger.summary}}"
32
33# Search Notion workspace:
34curl -X POST "https://api.notion.com/v1/search" \
35 -H "Authorization: Bearer YOUR_NOTION_API_KEY" \
36 -H "Notion-Version: 2022-06-28" \
37 -H "Content-Type: application/json" \
38 -d '{"query": "deployment checklist", "filter": {"value": "page", "property": "object"}}'

Pro tip: Create a Notion Board view filtered to 'Status = Error' on your activity log database — this gives you a one-glance error dashboard showing all failed OpenClaw workflows without needing to scroll through successful entries.

Expected result: OpenClaw automatically creates Notion database entries as workflows execute, building a searchable activity log visible in your Notion workspace.

Common use cases

Automated Task and Project Logging

OpenClaw creates new entries in a Notion task database whenever workflows complete, errors occur, or external events trigger logging. Each entry includes a timestamp, action type, status, and summary — building a persistent, searchable log of everything OpenClaw has done across all integrations.

OpenClaw Prompt

Configure OpenClaw to create a new row in my Notion 'Activity Log' database every time a workflow completes, with columns for: workflow name, status (success/error), integration used, timestamp, and a brief summary

Copy this prompt to try it in OpenClaw

CRM Database Updates from Messaging

When a new customer messages via Telegram or WhatsApp, OpenClaw looks up the contact in a Notion CRM database by phone number, updates the 'Last Contact' date property, adds a note about the interaction, and creates a follow-up task if needed. Keeps the CRM current without manual data entry.

OpenClaw Prompt

Set up OpenClaw to search my Notion CRM database for a contact when a new WhatsApp message arrives, update their 'Last Contacted' date, and create a task page if the message mentions 'urgent' or 'callback'

Copy this prompt to try it in OpenClaw

Knowledge Base Search and Retrieval

Use OpenClaw to search your Notion workspace for relevant information when answering questions. When a user asks a question via Discord or Telegram, OpenClaw queries the Notion search API across your documentation database, extracts the relevant content, and includes it in the AI-generated response.

OpenClaw Prompt

Build an OpenClaw workflow that searches my Notion 'Product Documentation' database when a support question arrives, finds the most relevant page, and uses its content to generate an accurate answer

Copy this prompt to try it in OpenClaw

Troubleshooting

404 object_not_found error when querying a Notion database

Cause: The integration has not been granted access to the database. Creating an API integration does not automatically grant access — each database must be explicitly shared with the integration via the 'Connect to' menu in Notion.

Solution: Open the database in Notion, click the three-dot menu (⋯) > 'Connect to' > find your integration name > Confirm. Also verify the database ID in your config is correct — copy it directly from the Notion URL to avoid typos.

typescript
1# Verify the database ID by checking the URL:
2# https://www.notion.so/workspace/DATABASE_ID_HERE?v=...
3# The ID is 32 hex characters copy and paste rather than typing manually

400 validation_error when creating a Notion page — 'body failed validation'

Cause: The property value format in the API call does not match the property type in the Notion database schema. Each property type (title, text, select, date, number, etc.) has a specific JSON structure.

Solution: Fetch the database schema first with `GET /v1/databases/{database_id}` and check the exact property types. For each property being written, use the correct JSON structure for that type. Common mistake: using `rich_text` format for a `title` property or vice versa.

typescript
1# Fetch database schema to see exact property types:
2curl -H "Authorization: Bearer YOUR_NOTION_API_KEY" \
3 -H "Notion-Version: 2022-06-28" \
4 https://api.notion.com/v1/databases/YOUR_DATABASE_ID
5# Look at the 'properties' object each key shows its type

Notion API returns 429 Too Many Requests

Cause: Notion enforces a rate limit of 3 requests per second per integration. High-frequency polling or bulk operations that exceed this limit trigger rate limiting.

Solution: Add delays between API calls in bulk operations. Reduce polling frequency for monitoring workflows to once every 30-60 seconds minimum. For bulk data sync, use batch operations and respect the `retry-after` header value in 429 responses.

typescript
1# Notion rate limit response headers:
2# Retry-After: 1 (seconds to wait before retrying)
3# Rate limit: 3 requests/second
4# For bulk imports, target 2 requests/second to stay safely under the limit

NOTION_API_KEY not found or integration returns empty results

Cause: The API key variable is not set in the environment, or the key in config has extra whitespace, quotes, or a prefix error (e.g., missing `secret_` prefix).

Solution: Verify the API key in config starts with `secret_` and has no extra spaces or newline characters. Test it directly with the getMe endpoint. If using environment variable substitution, verify the variable is exported in your shell: `echo $NOTION_API_KEY`.

typescript
1# Verify exact API key format:
2curl -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Notion-Version: 2022-06-28" \
4 https://api.notion.com/v1/users/me
5# Returns 401 if key is wrong, bot user details if correct

Best practices

  • Share only the specific databases and pages OpenClaw needs access to — using Notion's granular 'Connect to' access control is better security practice than sharing your entire workspace with the integration.
  • Store NOTION_API_KEY as an environment variable (`${NOTION_API_KEY}`) in OpenClaw's config rather than hardcoding it — the key grants write access to everything you have shared with the integration.
  • Create a dedicated 'OpenClaw Activity' database in Notion for logging all automation activity — this gives you a single searchable history of what OpenClaw has done, separate from your regular project databases.
  • Fetch the database schema before building write workflows — run `GET /v1/databases/{id}` once to understand the property names and types, then build your property values to match exactly to avoid validation errors.
  • Use Notion's filter and sort parameters in database queries rather than fetching all records and filtering in OpenClaw — this reduces API call size and stays within Notion's 100-result page limit more efficiently.
  • Design Notion database schemas for OpenClaw-generated entries to be human-readable without context — include a text summary field rather than just status codes, so the Notion database is useful to review without understanding OpenClaw's internals.
  • Batch Notion API calls when doing bulk operations — respect the 3 requests/second rate limit by adding a 400ms delay between sequential calls in bulk sync workflows.

Alternatives

Frequently asked questions

How do I set up Notion integration in OpenClaw?

Go to notion.so/my-integrations, create a new Internal Integration, copy the token (your NOTION_API_KEY), and add it under `integrations.notion.api_key` in `~/.openclaw/config.yaml`. Then share each Notion database you want OpenClaw to access: open the database > three-dot menu > Connect to > select your integration. Run `clawhub reload` to activate.

Where do I find my NOTION_API_KEY for OpenClaw?

Your Notion API key (Internal Integration Token) is found at notion.so/my-integrations. Create a new integration or click an existing one to see its token. Tokens start with `secret_` and are 50 characters long. If you have lost the token, you cannot retrieve it — generate a new one by clicking 'Regenerate' on the integration page.

Why does OpenClaw get a 404 error when accessing my Notion database?

The most common cause is that the integration has not been granted access to the database. Even with a valid API key, Notion requires you to explicitly share each database with the integration. Open the database in Notion, click the three-dot menu (⋯) > 'Connect to' > select your integration name. Also verify the database ID in your config matches the ID in the Notion URL exactly.

Can OpenClaw search across my entire Notion workspace?

Yes — set `search_enabled: true` in your Notion config and use the `/v1/search` endpoint. OpenClaw can search across all pages and databases that have been shared with the integration. You can filter results by object type (page or database), and sort by relevance or last edited time. Content inside pages is included in search results.

What is the difference between Notion and Notion CLI integration in OpenClaw?

The Notion direct API integration is for real-time CRUD operations — creating entries, updating properties, querying databases as events happen in OpenClaw workflows. Notion CLI is for batch and scripted operations — bulk exports, mass updates, data migration, and shell-script-driven workflows where CLI commands are more convenient than direct API calls. Use the direct API for automation and the CLI for maintenance tasks.

Is there help available for building Notion automations with OpenClaw?

RapidDev's team builds custom OpenClaw + Notion workflows including CRM automation, project management integration, knowledge base search pipelines, and multi-database sync setups. If you are building something complex — multiple databases, bidirectional sync, or Notion as the primary data layer for your AI agent — reach out for direct support.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.