详细分析 ▾
- 要求发布者更正清单以声明所需的凭证或配置路径
- 优先将令牌存储在安全密钥管理器或平台密钥存储中,而不是纯文本文件
- 仅提供您信任的Notion集成令牌(创建具有最小范围的专用集成,而不是重用强大的账户令牌)
- 如果您依赖新描述的功能,请验证Notion-Version头和端点日期
- 避免授予不受信任的技能持久或广泛的访问权限——如果平台允许每技能秘密,请使用它而不是将令牌放在您的主目录中
运行时依赖
版本
更新技能名称和描述以反映2026年1月15日的Notion API更改。无功能或代码更改;仅文档和元数据。
安装命令 点击复制
技能文档
Here is the complete SKILL.md file updated for the January 15, 2026 API state.
---
name: notion api 202601 15
description: Notion API updated to 2026 01 15 changes for creating, moving, and managing pages, data sources, and blocks.
homepage: https://developers.notion.com
metadata: {"clawdbot":{"emoji":"📝"}}
# notion
Use the Notion API to create/read/update/move pages, data sources (databases), and blocks.
Setup
- Create an integration at https://notion.so/my-integrations
- Copy the API key (starts with
ntn_ or secret_)
- Store it:
bash
mkdir -p ~/.config/notion
echo "ntn_your_key_here" > ~/.config/notion/api_key
- Share target pages/databases with your integration (click "..." → "Connect to" → your integration name)
API Basics
All requests need:
bash
NOTION_KEY=$(cat ~/.config/notion/api_key)
curl -X GET "https://api.notion.com/v1/..." \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03" \
-H "Content-Type: application/json"
Note: The Notion-Version header is required. Use 2025-09-03. The features released in Jan 2026 (Move Page, Templates) are additive and use this version header.
Common Operations
Search for pages and data sources:
bash
curl -X POST "https://api.notion.com/v1/search" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03" \
-H "Content-Type: application/json" \
-d '{"query": "page title"}'
Get page:bash
curl "https://api.notion.com/v1/pages/{page_id}" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03"
Move a page (Change Parent):bash
curl -X POST "https://api.notion.com/v1/pages/{page_id}/move" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03" \
-H "Content-Type: application/json" \
-d '{
"parent": {"type": "page_id", "page_id": "new_parent_page_id"}
}'
Note: To move to a database, use {"type": "data_source_id", "data_source_id": "..."}.
Create page (Standard):
bash
curl -X POST "https://api.notion.com/v1/pages" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03" \
-H "Content-Type: application/json" \
-d '{
"parent": {"database_id": "xxx"},
"properties": {
"Name": {"title": [{"text": {"content": "New Item"}}]},
"Status": {"select": {"name": "Todo"}}
}
}'
Create page from Template:bash
curl -X POST "https://api.notion.com/v1/pages" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03" \
-H "Content-Type: application/json" \
-d '{
"parent": {"database_id": "xxx"},
"template": {"type": "template_id", "template_id": "yyy"}
}'
List Data Source Templates:bash
curl -X GET "https://api.notion.com/v1/data_sources/{data_source_id}/templates" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03"
Update page properties:bash
curl -X PATCH "https://api.notion.com/v1/pages/{page_id}" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03" \
-H "Content-Type: application/json" \
-d '{
"properties": {"Status": {"select": {"name": "Done"}}},
"is_locked": true
}'
Apply Template to existing page (erasing content):bash
curl -X PATCH "https://api.notion.com/v1/pages/{page_id}" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03" \
-H "Content-Type: application/json" \
-d '{
"template": {"type": "template_id", "template_id": "yyy"},
"erase_content": true
}'
Query a data source (database):bash
curl -X POST "https://api.notion.com/v1/data_sources/{data_source_id}/query" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03" \
-H "Content-Type: application/json" \
-d '{
"filter": {"property": "Status", "select": {"equals": "Active"}},
"sorts": [{"property": "Date", "direction": "descending"}]
}'
Add blocks to page:bash
curl -X PATCH "https://api.notion.com/v1/blocks/{page_id}/children" \
-H "Authorization: Bearer $NOTION_KEY" \
-H "否tion-版本: 2025-09-03" \
-H "Content-Type: application/json" \
-d '{
"children": [
{"object": "block", "type": "paragraph", "paragraph": {"rich_text": [{"text": {"content": "Hello"}}]}}
]
}'
Property Types
Common property formats for database items:
Title: {"title": [{"text": {"content": "..."}}]}
Rich text: {"rich_text": [{"text": {"content": "..."}}]}
Select: {"select": {"name": "Option"}}
Multi-select: {"multi_select": [{"name": "A"}, {"name": "B"}]}
Date: {"date": {"start": "2024-01-15", "end": "2024-01-16"}}
Checkbox: {"checkbox": true}
Number: {"number": 42}
URL: {"url": "https://..."}
Email: {"email": "a@b.com"}
Relation: {"relation": [{"id": "page_id"}]}
Recent Changes (Jan 2026)
Move Page API: Use /v1/pages/{id}/move to reparent pages.
Templates: New endpoints to list templates and parameters to apply them during page creation/update.
Locking: is_locked boolean now supported in Update Page.
Tokens: New tokens use ntn_ prefix (formerly secret_).
Data Sources: Continue using data_source_id for queries (introduced in 2025-09-03).
Notes
Page/database IDs are UUIDs (with or without dashes)
The API cannot set database view filters — that's UI-only
Rate limit: ~3 requests/second average
* Use is_inline: true when creating data sources to embed them in pages
```
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制