# usergroup.massupdate

### Description

`object usergroup.massupdate(object parameters)`

This method allows to simultaneously update properties, users or
permissions for multiple user groups.

::: notewarning
This method is deprecated and will be removed in the
future. Please use [usergroup.update](update) instead.
:::

### Parameters

`(object)` Parameters containing the IDs of the user groups to update
and the properties that should be updated.

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

|Parameter|Type|Description|
|---------|----|-----------|
|**usrgrpids**<br>(required)|string/array|IDs of user groups to update.|
|rights|string/array|Permissions to replace the current permissions assigned to the user group.|
|userids|object/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

#### Changing permissions for a user group

Update the permissions for two user groups to only allow read-write
access to two host groups.

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "usergroup.massupdate",
    "params": {
        "usrgrpids": [
            "17",
            "19"
        ],
        "rights": [
            {
                "permission": 3,
                "id": "2"
            },
            {
                "permission": 3,
                "id": "3"
            }
        ]
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

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

### See also

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

### Source

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