Notion Workspace (notion-workspace)
Standalone skill for Notion pages, databases, and workspace automation via AISA. No other skill required.
Covers: OAuth connect, tool discovery/execute, Notion ID rules, triggers, and MCP for Notion only.
Quick Start
export AISA_API_KEY="your-key" # Linux/macOS
# $env:AISA_API_KEY = "your-key" # Windows PowerShell
- Base URL:
https://api.aisa.one - Path prefix:
/apis/v1/composio/... - Toolkit slug:
notion - Header:
Authorization: Bearer $AISA_API_KEY
Windows: Use curl.exe in PowerShell.
HTTP patterns (session, OAuth, execute, triggers): references/api_basics.md
When to use
- Search, read, or write Notion pages and databases
- Connect a user/workspace to Notion (OAuth or API key)
- Insert or update database rows, append page content, export Markdown
- Notion triggers, webhooks, or Notion-only MCP server
When NOT to use
- No
AISA_API_KEY— get one at aisa.one - Direct upstream provider endpoints without the AISA gateway
- Official Notion API only (no AISA gateway)
- Other toolkits (GitHub, Slack, Gmail, etc.) — use a different skill
What Can You Do?
"Connect user alice to Notion via OAuth"
"Search for pages titled Roadmap and export Markdown"
"Add a row to my Tasks database with status In Progress"
"Create a child page under X and append bullet content"
"Set up a trigger when a new row is added to database Y"
Intent → Workflow
| User intent | Read this |
|---|---|
| API key / session / generic curl | references/api_basics.md |
| connect / OAuth / authorize Notion | references/workflow_connect.md |
| search / find page or database | references/workflow_read.md § Search |
| read markdown / page content / blocks | references/workflow_read.md § Content |
| query database / filter rows | references/workflow_database.md § Query |
| create page / write content / append blocks | references/workflow_write_page.md |
| insert row / update properties | references/workflow_database.md § Write |
| comments / file upload | references/notion_intent_to_tool.md |
| page updated / trigger / webhook / MCP | references/notion_triggers.md |
| errors / 404 / wrong ID type | references/notion_gotchas.md |
| non-ASCII / Chinese field names / mojibake | references/notion_gotchas.md § 8 |
| which tool slug? | references/notion_intent_to_tool.md |
Unclear intent:
GET auth/session/info, ensureconnected_account_id(N1), then ask read vs write.
Core Workflows
N1 — Connect Notion
GET /auth_configs?toolkit_slug=notion→auth_config_id- Confirm with user →
POST /connected_accounts/linkwithuser_id - User opens
redirect_urlin browser - Poll
GET /connected_accounts?user_ids={user_id}&toolkit_slugs=notionevery 3–5s untilACTIVE(~2 min max) - Save
items[].idasconnected_account_id
If ACTIVE already exists for same user_id + notion, reuse it.
Details: references/workflow_connect.md
N2 — Discover and read
- Resolve
connected_account_id(N1 if missing) - Discover IDs:
NOTION_SEARCH_NOTION_PAGEorNOTION_FETCH_DATA - Read page:
NOTION_GET_PAGE_MARKDOWNorNOTION_FETCH_BLOCK_CONTENTS - Read database:
NOTION_FETCH_DATABASE→NOTION_QUERY_DATABASEorNOTION_QUERY_DATABASE_WITH_FILTER
Details: references/workflow_read.md
N3 — Write pages and blocks
- Resolve
connected_account_id(N1 if missing) GET /tools/{tool_slug}— never guess slug; seereferences/notion_intent_to_tool.md- Confirm with user before any write
- Create page:
NOTION_CREATE_NOTION_PAGE(parent_id,title) → save returnedid - Add body:
NOTION_ADD_MULTIPLE_PAGE_CONTENT(parent_block_id,content_blocks[]) - Check
successfulin response; on false readerror
Key param:
NOTION_ADD_MULTIPLE_PAGE_CONTENTusesparent_block_id(notpage_id) andcontent_blocks(notchild_blocks).
Details: references/workflow_write_page.md
N4 — Database rows
- Check sharing: Confirm the target database (and its parent page chain up to workspace root) is shared with the AISA integration in Notion UI (⋯ → Connections). A 404 on execute almost always means the integration cannot see the resource.
- Always
NOTION_FETCH_DATABASEfirst - Confirm with user →
NOTION_INSERT_ROW_DATABASE(propertiesas list of{name, type, value}) - Update:
NOTION_UPDATE_PAGE; filter:NOTION_QUERY_DATABASE_WITH_FILTER
Details: references/workflow_database.md
N5 — Troubleshoot
references/notion_gotchas.md + references/api_basics.md Troubleshooting table.
Execute pattern (all Notion tools)
curl -X POST "https://api.aisa.one/apis/v1/composio/tools/execute/NOTION_SEARCH_NOTION_PAGE" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"connected_account_id": "ca_xxxxxxxx",
"user_id": "alice@example.com",
"arguments": { }
}'
Schema: GET /tools/{tool_slug} → input_parameters.
List tools: GET /tools?toolkit_slug=notion&limit=50
Safety
- Confirm before POST that writes to Notion or changes triggers/webhooks/MCP
- Read-only GET/list/search need no confirmation unless user forbids network
- OAuth
redirect_urlmust be opened by a human - Never use mock IDs (
test_nanoid_001)
Reference routing
| Topic | File |
|---|---|
| Gateway, OAuth, execute, triggers HTTP | references/api_basics.md |
| Notion pitfalls | references/notion_gotchas.md |
| Intent → tool_slug | references/notion_intent_to_tool.md |
| Connect | references/workflow_connect.md |
| Read / search | references/workflow_read.md |
| Write pages | references/workflow_write_page.md |
| Database | references/workflow_database.md |
| Triggers, MCP | references/notion_triggers.md |