用途:借助 uxc 与精选 OpenAPI schema 执行 Notion Public API 操作,偏读取优先,同时包含常用内容写入。
主要能力:令牌身份校验(get:/users/me)、标题搜索(post:/search)、页面与块查询、通过块子级分页递归遍历、页面属性读取、页面创建与更新(含 in_trash 回收/恢复)、块追加/更新/删除、数据源检索与查询、旧版数据库检索与查询。不覆盖完整 REST、评论、文件上传、webhook、页面移动或 schema 变更,也不在单条命令内自动递归。
使用方式:需 uxc 在 PATH 中、可访问 https://api.notion.com/v1、可访问精选 schema URL,并具备集成令牌或 OAuth 凭据。认证头为 Authorization: Bearer <token> 与 Notion-Version: 2026-03-11。可用 uxc auth credential set/binding add 配置,或走 OAuth 流程。默认用固定链接命令:command -v notion-openapi-cli;缺失时用 uxc link notion-openapi-cli https://api.notion.com/v1 --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/notion-openapi-skill/references/notion-public.openapi.json 创建。先查操作 schema(如 notion-openapi-cli post:/search -h),再执行读取验证,写入前需用户明确确认。
限制:块子级接口一次只返回一层,递归需多次调用;可能返回少于 page_size,需检查 has_more 与 next_cursor;追加子块单次最多 100 个、最多两层嵌套;更新块内容不更新子列表;新流程优先 data_sources 端点;集成需在 Notion 中连接目标内容,否则可能鉴权成功但访问失败或搜索结果不全;保持 JSON 输出,不用 --text。