**版本：202601**

# 保存自定义卡片模板

**POST** `/openapi/2026-01/themes/page-builder/custom-templates`

基于已有模板保存一个自定义卡片模板，由 `action` 决定保存方式。三种方式都会生成新的模板 id，`update` 会让原模板下线。

## 请求

**application/json**

**请求体 | 示例**

**请求体 (required)**

- `action` string (required)

  动作。三种都会新建一个模板，区别在于是否进入模板列表：

  *   `save_as`：另存为新副本，进列表
  *   `update`：出新版本进列表，同时把 `template_id` 对应的旧模板下线
  *   `save`：仅保存，不在模板列表中展示
- `template_id` string (required)

  `save_as` 的源模板 id / `update` 要出新版本的模板 id
- `title` object

  模板名称（多语言 map）。可选，默认沿用源模板
- `category` string

  一级分类。可选，默认沿用源
- `second_category` string

  二级分类。可选，默认沿用源
- `image` string

  预览图文件名。可选，默认沿用源
- `origin` string

  来源类型：`custom`、`global`。可选，默认沿用源

```json
{
  "action": "string",
  "template_id": "string",
  "title": {},
  "category": "string",
  "second_category": "string",
  "image": "string",
  "origin": "string"
}
```

## 响应

**200**

OK

**application/json**

**数据结构 | 示例**

**数据结构**

- `code` string

  错误码
- `message` string

  错误信息
- `data` object

  - `id` string

    保存后的模板 id。始终是新 id —— `update` 同样是新建模板并把入参 `template_id` 的旧模板隐藏
  - `series_id` string

    系列 id
  - `show_templates` int32

    展示模板数

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "id": "string",
    "series_id": "string",
    "show_templates": 0
  }
}
```
