# usergroup.update

### Description

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

This method allows to update existing user groups.

### Parameters

`(object/array)` User group properties to be updated.

The `usrgrpid` property must be defined for each user group, all other
properties are optional. Only the passed properties will be updated, all
others will remain unchanged.

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

|Parameter|Type|Description|
|---------|----|-----------|
|rights|object/array|Permissions to replace the current permissions assigned to the user group.|
|userids|string/array|IDs of the users to replace the users in the group.|

### Return values

`(object)` Returns an object containing the IDs of the updated user
groups under the `usrgrpids` property.

### Examples

#### Disabling a user group

Disable a user group.

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "usergroup.update",
    "params": {
        "usrgrpid": "17",
        "users_status": "1"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

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

### See also

-   [Permission](object#permission)
-   [usergroup.massadd](massadd)
-   [usergroup.massupdate](massupdate)

### Source

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