Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: 提供插入块、更新块和删除块的 API https://github.com/siyuan-note/siyuan/issues/3334

Liang Ding337e93b4f623
diff --git a/API.md b/API.md
index 2bf257dcd9..a06212af1f 100644
--- a/API.md
+++ b/API.md
@@ -522,6 +522,42 @@
* `action.data`:更新块生成的 DOM
+### 删除块
+
+* `/api/block/deleteBlock`
+* 参数
+
+ ```json
+ {
+ "id": "20211230161520-querkps"
+ }
+ ```
+
+ * `id`:待删除块 ID
+* 返回值
+
+ ```json
+ {
+ "code": 0,
+ "msg": "",
+ "data": [
+ {
+ "doOperations": [
+ {
+ "action": "delete",
+ "data": null,
+ "id": "20211230162439-vtm09qo",
+ "parentID": "",
+ "previousID": "",
+ "retData": null
+ }
+ ],
+ "undoOperations": null
+ }
+ ]
+ }
+ ```
+
## 属性
### 设置块属性