[comment]: # ({c40e8cd1-c40e8cd1})
# usergroup.create

[comment]: # ({/c40e8cd1-c40e8cd1})

[comment]: # ({3116b5a6-c74b5711})
### Description

`object usergroup.create(object/array userGroups)`

This method allows to create new user groups.

[comment]: # ({/3116b5a6-c74b5711})

[comment]: # ({92d9519d-7d360fcf})
### Parameters

`(object/array)` User groups to create.

Additionally to the [standard user group properties](object#user_group),
the method accepts the following parameters.

|Parameter|Type|Description|
|---------|----|-----------|
|rights|object/array|Permissions to assign to the group|
|tag\_filters|array|Tag based permissions to assign to the group|
|userids|string/array|IDs of users to add to the user group.|

[comment]: # ({/92d9519d-7d360fcf})

[comment]: # ({19e4f0cc-19e4f0cc})
### Return values

`(object)` Returns an object containing the IDs of the created user
groups under the `usrgrpids` property. The order of the returned IDs
matches the order of the passed user groups.

[comment]: # ({/19e4f0cc-19e4f0cc})

[comment]: # ({b41637d2-b41637d2})
### Examples

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

[comment]: # ({8169a63d-8169a63d})
#### Creating a user group

Create a user group, which denies access to host group "2", and add a
user to it.

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "usergroup.create",
    "params": {
        "name": "Operation managers",
        "rights": {
            "permission": 0,
            "id": "2"
        },
        "userids": "12"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "usrgrpids": [
            "20"
        ]
    },
    "id": 1
}
```

[comment]: # ({/8169a63d-8169a63d})

[comment]: # ({d5c7ed4f-d5c7ed4f})
### See also

-   [Permission](object#permission)

[comment]: # ({/d5c7ed4f-d5c7ed4f})

[comment]: # ({8e3f7195-2d7f8c71})
### Source

CUserGroup::create() in
*frontends/php/include/classes/api/services/CUserGroup.php*.

[comment]: # ({/8e3f7195-2d7f8c71})
