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

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

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

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

此方法允许创建新模板组.

::: noteclassic
此方法只有Super admin(超级管理员)用户可用.
可以在用户角色设置中撤销调用该方法的权限. 
更多信息请查看 [用户角色](/manual/web_interface/frontend_sections/users/user_roles).
:::

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

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

`(object/array)` 要创建的模板组。该方法接受具有[标准模板组属性](object#template-group)的模板组。

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

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

`(object)` 返回一个对象，该对象包含 `groupids`属性下创建的模板组的ID.返回ID的顺序与传递模板组的顺序匹配.

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

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

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

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

创建一个名为"Templates/Databases"的模板组.

[请求](/manual/api#performing-requests):

```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() in *ui/include/classes/api/services/CTemplateGroup.php*.

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