版本:202607
批量主题操作
POST/openapi/2026-07/themes/edit-sessions/:oseid/files/:doc_id/operations
一次请求批量执行多条主题操作;单条独立生效、独立落库,某条失败不影响其它条目继续执行。
请求
Path参数
oseid string必填
编辑会话 ID(oseid)
doc_id string必填
会话内文件的文档 ID
- application/json
- 请求体
- 示例
请求体必填
- Array [
- ]
operations object[]必填
一次批量执行的主题操作列表(有序)。
单条独立生效、独立落库,某条失败不影响其它条。详见 ThemeOperation。
opstring必填
要执行的操作,取值之一:
add_section、remove_section、move_section、replace_props、set_visibility、
append_array_item、remove_array_item、update_slot、replace_global、set_script_visibility。
targetstring
目标卡片或 block 的路径,具体含义随 op 而定。定位卡片时传其 section id;定位内部 block 时
使用点号路径,如 sec1.blocks.0(更深层为 sec1.blocks.0.blocks.2)。
valueGoogleProtobufValue
新的卡片、block 或 blocks 数组内容。适用于 add_section、append_array_item、update_slot。
propsobject
要合并写入的 settings 字段。适用于 replace_props、replace_global。
visibleboolean
目标的可见性。适用于 set_visibility、set_script_visibility。
positionstring
相对目标的位置:before 或 after。适用于 add_section、move_section。
move_targetstring
作为移动参照的卡片 id,目标将被放置到它旁边。适用于 move_section。
{
"operations": [
{
"op": "string",
"target": "string",
"props": {},
"visible": true,
"position": "string",
"move_target": "string"
}
]
}
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
- Array [
- ]
codestring
错误码
messagestring
错误信息
data object
data object[]
各条操作的执行结果。
opstring
操作类型,回显对应请求项中的 op。
resultstring
该操作的结果:成功时为 success,否则为错误码(可能带 :详情 后缀)。
{
"code": "string",
"message": "string",
"data": {
"data": [
{
"op": "string",
"result": "string"
}
]
}
}