Developer API
V2

更新页面

更新页面属性、图标、封面或回收站状态,并支持并发控制。

PATCH /v2/pages/:page_id

更新页面

适用场景

当你要改写页面标题、页面属性、图标、封面,或切换页面的回收站状态时使用这个接口。它支持并发控制,适合多人协作场景。

接口信息

项目内容
方法PATCH
路径/v2/pages/:page_id
请求体page 局部更新参数
返回page
Scopepages.write

权限要求

需要 pages.write

请求参数

请求头

参数类型必填说明
AuthorizationstringBearer <token>
If-Matchstring乐观锁标记。建议填入上次读取到的页面版本标识。

请求头示例:

If-Match: W/"2026-04-09T09:30:00.000Z"

请求体

参数类型必填说明
propertiesobject页面属性,按需部分更新。
iconobject | null页面图标,设为 null 表示移除。
coverobject | null页面封面,设为 null 表示移除。
in_trashboolean回收站状态。

请求体示例:

{
  "properties": {
    "title": {
      "type": "title",
      "title": [
        {
          "type": "text",
          "text": {
            "content": "季度规划(更新)"
          }
        }
      ]
    }
  },
  "icon": {
    "type": "emoji",
    "emoji": "🚀"
  },
  "cover": {
    "type": "external",
    "external": {
      "url": "https://example.com/cover.png"
    }
  },
  "in_trash": false
}

响应结果

{
  "object": "page",
  "id": "22222222-2222-4222-8222-222222222222",
  "page_type": "page",
  "parent": {
    "type": "page_id",
    "page_id": "55555555-5555-4555-8555-555555555555"
  },
  "in_trash": false,
  "icon": {
    "type": "emoji",
    "emoji": "🚀"
  },
  "cover": null,
  "properties": {
    "title": {
      "id": "title",
      "type": "title",
      "title": [
        {
          "type": "text",
          "text": {
            "content": "季度规划(更新)",
            "link": null
          },
          "plain_text": "季度规划(更新)",
          "href": null
        }
      ]
    }
  }
}

行为说明或限制

  • 这是部分更新接口,只会更新你传入的字段。
  • properties 只会覆盖对应属性,不会清空未传入的其他属性。
  • iconcovernull 时表示移除。
  • in_trash 用于切换页面的回收站状态。
  • 如果传了 If-Match 且与当前版本不一致,会拒绝写入。

错误提示

  • 401 unauthorized:token 无效或已过期。
  • 403 forbidden:缺少 pages.write 或无权访问该页面。
  • 404 not_found:页面不存在。
  • 409 conflictIf-Match 与当前页面版本不一致。

相关文档

前置阅读

下一步

相关参考