版本:202601
保存自定义卡片模板
POST/openapi/2026-01/themes/page-builder/custom-templates
基于已有模板保存一个自定义卡片模板,由 action 决定保存方式。三种方式都会生成新的模板 id,update 会让原模板下线。
请求
- application/json
- 请求体
- 示例
请求体必填
save_as:另存为新副本,进列表update:出新版本进列表,同时把template_id对应的旧模板下线save:仅保存,不在模板列表中展示
actionstring必填
动作。三种都会新建一个模板,区别在于是否进入模板列表:
template_idstring必填
save_as 的源模板 id / update 要出新版本的模板 id
titleobject
模板名称(多语言 map)。可选,默认沿用源模板
categorystring
一级分类。可选,默认沿用源
second_categorystring
二级分类。可选,默认沿用源
imagestring
预览图文件名。可选,默认沿用源
originstring
来源类型:custom、global。可选,默认沿用源
json
{
"action": "string",
"template_id": "string",
"title": {},
"category": "string",
"second_category": "string",
"image": "string",
"origin": "string"
}
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
codestring
错误码
messagestring
错误信息
data object
idstring
保存后的模板 id。始终是新 id —— update 同样是新建模板并把入参 template_id 的旧模板隐藏
series_idstring
系列 id
show_templatesint32
展示模板数
json
{
"code": "string",
"message": "string",
"data": {
"id": "string",
"series_id": "string",
"show_templates": 0
}
}