[comment]: # translation:outdated

[comment]: # ({c5e721d8-f9e8f670})
# templategroup.create

[comment]: # ({/c5e721d8-f9e8f670})

[comment]: # ({e21431df-b5ff62ed})
### 描述

`object templategroup.create(object/array templateGroups)`

此方法用于 create 新的模板组。

::: noteclassic
此方法仅适用于 *超级管理员* 用户类型。
可以在用户角色设置中撤销调用该方法的权限。更多信息请参见
[User
roles](/manual/web_interface/frontend_sections/users/user_roles)
:::

[comment]: # ({/e21431df-b5ff62ed})

[comment]: # ({e4a03979-6102edd8})
### 参数

`(object/array)` 要创建的模板组。该方法接受带有[模板组](object#模板组)的模板组。

[comment]: # ({/e4a03979-6102edd8})

[comment]: # ({cd6782ad-76d53254})
### 返回值

`(object)` 返回一个object，其中包含在 `groupids` 属性下列出的已创建模板组的 ID。返回的 ID 顺序与传入的模板组顺序一致。

[comment]: # ({/cd6782ad-76d53254})

[comment]: # ({b41637d2-e8653e4d})
### 示例

[comment]: # ({/b41637d2-e8653e4d})

[comment]: # ({c2e0e8c7-1aca44e8})
#### 创建模板组

创建一个名为“Templates/Databases”的模板组。

[执行请求](/manual/api#执行请求):


```json
{
    "jsonrpc": "2.0",
    "method": "templategroup.create",
    "params": {
        "name": "Templates/Databases"
    },
    "id": 1
}
```
响应：


```json
{
    "jsonrpc": "2.0",
    "result": {
        "groupids": [
            "107820"
        ]
    },
    "id": 1
}
```

[comment]: # ({/c2e0e8c7-1aca44e8})

[comment]: # ({f3aa7eca-225e8cd3})
### 来源

CTemplateGroup::create() 在
*ui/include/classes/api/services/CTemplateGroup.php* 中。

[comment]: # ({/f3aa7eca-225e8cd3})
