Notion
Overview
Productivity and collaboration workspace. Enterprise archetype.
Workflows
Search pages
getSpaces → pick workspace → spaceId
searchPages(query, spaceId) → results with page id, title, score
Read a page
searchPages(query, spaceId) → find page id in results
getPage(pageId) → blocks in recordMap.block, properties in root block's value.properties
Query a database
searchPages(query, spaceId) → find collection_view_page blocks in recordMap.block → collection_id, view_ids
queryDatabase(collectionId, viewId) → rows with property values
Note: collection_id is found in blocks of type collection_view_page within search results' recordMap.block. It may not appear in system databases ("Home views", "My Tasks") — only user-created databases.
Create a page
getSpaces → spaceId
createPage(title, spaceId) → new pageId
- Optionally pass
parentId to nest under an existing page
Update a page
searchPages(query, spaceId) → find page → pageId
updatePage(pageId, title, spaceId) → updated page info
Delete a page
searchPages(query, spaceId) → find page → pageId
deletePage(pageId, spaceId) → deleted: true
- Moves page to trash — recoverable from Notion UI
- Reverse of
createPage
Operations
| Operation |
Intent |
Key Input |
Key Output |
Notes |
| getSpaces |
list workspaces |
— |
userId, spaceId |
entry point for spaceId |
| searchPages |
full-text search |
query, spaceId |
results[].id, score, recordMap |
paginated via limit |
| getPage |
read page content |
pageId |
recordMap.block (page tree), cursor |
paginated via chunkNumber |
| queryDatabase |
filter/sort database rows |
collectionId, viewId |
blockIds, recordMap.block (rows) |
needs collectionId from search |
| createPage |
create page |
title, spaceId, parentId? |
pageId |
write op — adapter-based |
| deletePage |
delete (trash) page |
pageId, spaceId |
deleted: true |
write op — reverse of createPage |
| updatePage |
update page title |
pageId, title, spaceId |
updated: true |
write op — adapter-based |
Write Operations Safety
| Operation |
Level |
Notes |
| createPage |
CAUTION |
Creates a real page in workspace — delete manually if testing |
| deletePage |
CAUTION |
Moves page to trash — recoverable from Notion UI |
| updatePage |
CAUTION |
Overwrites page title — reversible by updating again |
Quick Start
# Get workspace spaceId
openweb notion exec getSpaces '{}'
# Search pages
openweb notion exec searchPages '{"x-notion-space-id":"<spaceId>","type":"BlocksInSpace","query":"meeting","spaceId":"<spaceId>","limit":20,"source":"quick_find","filters":{"isDeletedOnly":false,"excludeTemplates":false,"navigableBlockContentOnly":false,"requireEditPermissions":false,"includePublicPagesWithoutExplicitAccess":false,"ancestors":[],"createdBy":[],"editedBy":[],"lastEditedTime":{},"createdTime":{},"inTeams":[],"excludeSurrogateCollections":false,"excludedParentCollectionIds":[]},"sort":{"field":"relevance"},"peopleBlocksToInclude":"all"}'
# Read a page's content
openweb notion exec getPage '{"x-notion-space-id":"<spaceId>","page":{"id":"<pageId>"},"limit":100,"cursor":{"stack":[]},"chunkNumber":0,"verticalColumns":false}'
# Query a database (requires collectionId and viewId from search results)
openweb notion exec queryDatabase '{"x-notion-space-id":"<spaceId>","collection":{"id":"<collectionId>"},"collectionView":{"id":"<viewId>"},"loader":{"type":"reducer","reducers":{"collection_group_results":{"type":"results","limit":50}},"searchQuery":"","userTimeZone":"America/Los_Angeles"}}'
# Create a new page at workspace top level
openweb notion exec createPage '{"x-notion-space-id":"<spaceId>","title":"My New Page"}'
# Create a subpage under an existing page
openweb notion exec createPage '{"x-notion-space-id":"<spaceId>","title":"Child Page","parentId":"<parentPageId>"}'
# Update a page's title
openweb notion exec updatePage '{"x-notion-space-id":"<spaceId>","pageId":"<pageId>","title":"New Title"}'
# Delete (trash) a page
openweb notion exec deletePage '{"x-notion-space-id":"<spaceId>","pageId":"<pageId>"}'
1---2name: notion3description: Notion4---5# Notion67## Overview8Productivity and collaboration workspace. Enterprise archetype.910## Workflows1112### Search pages131. `getSpaces` → pick workspace → `spaceId`142. `searchPages(query, spaceId)` → results with page `id`, `title`, `score`1516### Read a page171. `searchPages(query, spaceId)` → find page `id` in results182. `getPage(pageId)` → blocks in `recordMap.block`, properties in root block's `value.properties`1920### Query a database211. `searchPages(query, spaceId)` → find `collection_view_page` blocks in `recordMap.block` → `collection_id`, `view_ids`222. `queryDatabase(collectionId, viewId)` → rows with property values2324**Note:** `collection_id` is found in blocks of type `collection_view_page` within search results' `recordMap.block`. It may not appear in system databases ("Home views", "My Tasks") — only user-created databases.2526### Create a page271. `getSpaces` → `spaceId`282. `createPage(title, spaceId)` → new `pageId`29 - Optionally pass `parentId` to nest under an existing page3031### Update a page321. `searchPages(query, spaceId)` → find page → `pageId`332. `updatePage(pageId, title, spaceId)` → updated page info3435### Delete a page361. `searchPages(query, spaceId)` → find page → `pageId`372. `deletePage(pageId, spaceId)` → `deleted: true`38 - Moves page to trash — recoverable from Notion UI39 - Reverse of `createPage`4041## Operations4243| Operation | Intent | Key Input | Key Output | Notes |44|-----------|--------|-----------|------------|-------|45| getSpaces | list workspaces | — | userId, spaceId | entry point for spaceId |46| searchPages | full-text search | query, spaceId | results[].id, score, recordMap | paginated via limit |47| getPage | read page content | pageId | recordMap.block (page tree), cursor | paginated via chunkNumber |48| queryDatabase | filter/sort database rows | collectionId, viewId | blockIds, recordMap.block (rows) | needs collectionId from search |49| createPage | create page | title, spaceId, parentId? | pageId | write op — adapter-based |50| deletePage | delete (trash) page | pageId, spaceId | deleted: true | write op — reverse of createPage |51| updatePage | update page title | pageId, title, spaceId | updated: true | write op — adapter-based |5253### Write Operations Safety5455| Operation | Level | Notes |56|-----------|-------|-------|57| createPage | CAUTION | Creates a real page in workspace — delete manually if testing |58| deletePage | CAUTION | Moves page to trash — recoverable from Notion UI |59| updatePage | CAUTION | Overwrites page title — reversible by updating again |6061## Quick Start6263```bash64# Get workspace spaceId65openweb notion exec getSpaces '{}'6667# Search pages68openweb notion exec searchPages '{"x-notion-space-id":"<spaceId>","type":"BlocksInSpace","query":"meeting","spaceId":"<spaceId>","limit":20,"source":"quick_find","filters":{"isDeletedOnly":false,"excludeTemplates":false,"navigableBlockContentOnly":false,"requireEditPermissions":false,"includePublicPagesWithoutExplicitAccess":false,"ancestors":[],"createdBy":[],"editedBy":[],"lastEditedTime":{},"createdTime":{},"inTeams":[],"excludeSurrogateCollections":false,"excludedParentCollectionIds":[]},"sort":{"field":"relevance"},"peopleBlocksToInclude":"all"}'6970# Read a page's content71openweb notion exec getPage '{"x-notion-space-id":"<spaceId>","page":{"id":"<pageId>"},"limit":100,"cursor":{"stack":[]},"chunkNumber":0,"verticalColumns":false}'7273# Query a database (requires collectionId and viewId from search results)74openweb notion exec queryDatabase '{"x-notion-space-id":"<spaceId>","collection":{"id":"<collectionId>"},"collectionView":{"id":"<viewId>"},"loader":{"type":"reducer","reducers":{"collection_group_results":{"type":"results","limit":50}},"searchQuery":"","userTimeZone":"America/Los_Angeles"}}'7576# Create a new page at workspace top level77openweb notion exec createPage '{"x-notion-space-id":"<spaceId>","title":"My New Page"}'7879# Create a subpage under an existing page80openweb notion exec createPage '{"x-notion-space-id":"<spaceId>","title":"Child Page","parentId":"<parentPageId>"}'8182# Update a page's title83openweb notion exec updatePage '{"x-notion-space-id":"<spaceId>","pageId":"<pageId>","title":"New Title"}'8485# Delete (trash) a page86openweb notion exec deletePage '{"x-notion-space-id":"<spaceId>","pageId":"<pageId>"}'87```