← 返回
未分类 Key 中文

Notion

Access and manage Notion workspaces via OAuth to search pages, create and update databases, pages, blocks, and retrieve user info.
通过 OAuth 访问管理 Notion 工作空间,搜索页面,创建和更新数据库、页面、块,获取用户信息。
otman-ai otman-ai 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 347
下载
💾 0
安装
1
版本
#latest

概述

Notion

Access the Notion API with managed OAuth authentication. Query databases, create pages, manage blocks, and search your workspace.

Quick Start

Search for pages

curl -X POST https://gateway.maton.ai/notion/v1/search \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"query": "meeting notes"

}'

Base URL

https://gateway.maton.ai/notion/{native-api-path}

Replace {native-api-path} with the actual Notion API endpoint path. The gateway proxies requests to api.notion.com and automatically injects your OAuth token.

Required Headers

All Notion API requests require:

Notion-Version: 2025-09-03

Authorization: Bearer $MATON_API_KEY

Content-Type: application/json

Authentication

Set your API key:

export MATON_API_KEY="YOUR_API_KEY"

Getting Your API Key

Sign in or create an account at maton.ai

Go to maton.ai/settings

Copy your API key

Connection Management

Manage your Notion OAuth connections at:

https://ctrl.maton.ai

List Connections

curl "https://ctrl.maton.ai/connections?app=notion&status=ACTIVE" \

-H "Authorization: Bearer $MATON_API_KEY"

Create Connection

curl -X POST https://ctrl.maton.ai/connections \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-d '{

"app": "notion"

}'

Get Connection

curl https://ctrl.maton.ai/connections/{connection_id} \

-H "Authorization: Bearer $MATON_API_KEY"

Delete Connection

curl -X DELETE https://ctrl.maton.ai/connections/{connection_id} \

-H "Authorization: Bearer $MATON_API_KEY"

Complete OAuth

Open the returned url from the connection response in a browser.

Specifying Connection

curl -X POST https://gateway.maton.ai/notion/v1/search \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-H "Maton-Connection: 21fd90f9-5935-43cd-b6c8-bde9d915ca80" \

-d '{

"query": "meeting notes"

}'

Key Concept: Databases vs Data Sources

Concept Use For

Database Creating databases, getting data source IDs

Data Source Querying, updating schema, properties

Example response:

{

"object": "database",

"id": "abc123",

"data_sources": [

{"id": "def456", "name": "My Database"}

]

}

API Reference

Search

Search for pages

curl -X POST https://gateway.maton.ai/notion/v1/search \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"query": "meeting notes",

"filter": { "property": "object", "value": "page" }

}'

Search for data sources

curl -X POST https://gateway.maton.ai/notion/v1/search \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"filter": { "property": "object", "value": "data_source" }

}'

Data Sources

Get Data Source

curl https://gateway.maton.ai/notion/v1/data_sources/{dataSourceId} \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Notion-Version: 2025-09-03"

Query Data Source

curl -X POST https://gateway.maton.ai/notion/v1/data_sources/{dataSourceId}/query \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"filter": {

"property": "Status",

"select": { "equals": "Active" }

},

"sorts": [

{ "property": "Created", "direction": "descending" }

],

"page_size": 100

}'

Update Data Source

curl -X PATCH https://gateway.maton.ai/notion/v1/data_sources/{dataSourceId} \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"title": [{ "type": "text", "text": { "content": "Updated Title" } }],

"properties": {

"NewColumn": { "rich_text": {} }

}

}'

Databases

Get Database

curl https://gateway.maton.ai/notion/v1/databases/{databaseId} \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Notion-Version: 2025-09-03"

Create Database

curl -X POST https://gateway.maton.ai/notion/v1/databases \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"parent": { "type": "page_id", "page_id": "PARENT_PAGE_ID" },

"title": [{ "type": "text", "text": { "content": "New Database" } }],

"properties": {

"Name": { "title": {} },

"Status": {

"select": {

"options": [{ "name": "Active" }, { "name": "Done" }]

}

}

}

}'

Pages

Get Page

curl https://gateway.maton.ai/notion/v1/pages/{pageId} \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Notion-Version: 2025-09-03"

Create Page

curl -X POST https://gateway.maton.ai/notion/v1/pages \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"parent": { "page_id": "PARENT_PAGE_ID" },

"properties": {

"title": {

"title": [{ "text": { "content": "New Page" } }]

}

}

}'

Create Page in Data Source

curl -X POST https://gateway.maton.ai/notion/v1/pages \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"parent": { "data_source_id": "DATA_SOURCE_ID" },

"properties": {

"Name": { "title": [{ "text": { "content": "New Page" } }] },

"Status": { "select": { "name": "Active" } }

}

}'

Update Page Properties

curl -X PATCH https://gateway.maton.ai/notion/v1/pages/{pageId} \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"properties": {

"Status": { "select": { "name": "Done" } }

}

}'

Archive Page

curl -X PATCH https://gateway.maton.ai/notion/v1/pages/{pageId} \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"archived": true

}'

Blocks

Get Block Children

curl https://gateway.maton.ai/notion/v1/blocks/{blockId}/children \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Notion-Version: 2025-09-03"

Append Block Children

curl -X PATCH https://gateway.maton.ai/notion/v1/blocks/{blockId}/children \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Content-Type: application/json" \

-H "Notion-Version: 2025-09-03" \

-d '{

"children": [

{

"object": "block",

"type": "paragraph",

"paragraph": {

"rich_text": [

{ "type": "text", "text": { "content": "New paragraph" } }

]

}

}

]

}'

Delete Block

curl -X DELETE https://gateway.maton.ai/notion/v1/blocks/{blockId} \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Notion-Version: 2025-09-03"

Users

List Users

curl https://gateway.maton.ai/notion/v1/users \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Notion-Version: 2025-09-03"

Get Current User

curl https://gateway.maton.ai/notion/v1/users/me \

-H "Authorization: Bearer $MATON_API_KEY" \

-H "Notion-Version: 2025-09-03"

Notes

All IDs are UUIDs

Use /databases/{id} to retrieve data_sources

Use curl -g if your URL contains brackets ([])

Avoid piping issues with $MATON_API_KEY in some shells

Error Handling

Status Meaning

400 Missing Notion connection

401 Invalid API key

429 Rate limited

4xx/5xx Notion API error

Troubleshooting

Check API key

echo $MATON_API_KEY

Test connection

curl https://ctrl.maton.ai/connections \

-H "Authorization: Bearer $MATON_API_KEY"

Common Mistake

Correct:

https://gateway.maton.ai/notion/v1/search

Incorrect:

https://gateway.maton.ai/v1/search

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 17:58 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Google Drive

otman-ai
通过 Google Drive API 和 OAuth 认证访问和管理 Google Drive 文件、文件夹、元数据、上传、下载和分享。
★ 0 📥 477

Meta Ads Api

otman-ai
通过 Marketing API 管理 Meta 广告系列,包括读取、创建、更新广告系列、广告组、广告、创意,并获取洞察数据。
★ 0 📥 370

Monday

otman-ai
通过 Maton Gateway 调用 Monday.com API,使用 GraphQL 与 OAuth 管理看板、项、列、群组、用户和工作区。
★ 0 📥 418