This is a translation of the original English documentation page. Help us make it better.


Become a monitoring expert!
Sign up for Zabbix training



object hostgroup.massupdate(object parameters)

This method allows to replace hosts and templates with the specified ones in multiple host groups.

This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.


(object) Parameters containing the IDs of the host groups to update and the objects that should be updated.

Parameter Type Description
object/array Host groups to be updated.

The host groups must have the groupid property defined.
object/array Hosts to replace the current hosts on the given host groups.
All other hosts, except the ones mentioned, will be excluded from host groups.
Discovered hosts will not be affected.

The hosts must have the hostid property defined.
object/array Templates to replace the current templates on the given host groups.
All other templates, except the ones mentioned, will be excluded from host groups.

The templates must have the templateid property defined.

Return values

(object) Returns an object containing the IDs of the updated host groups under the groupids property.


Replacing hosts and templates in a host group

Replace all hosts in a host group to ones mentioned host and unlink all templates from host group.


           "jsonrpc": "2.0",
           "method": "hostgroup.massupdate",
           "params": {
               "groups": [
                       "groupid": "6"
               "hosts": [
                       "hostid": "30050"
               "templates": []
           "auth": "f223adf833b2bf2ff38574a67bba6372",
           "id": 1


           "jsonrpc": "2.0",
           "result": {
               "groupids": [
           "id": 1

See also


CHostGroup::massUpdate() in ui/include/classes/api/services/CHostGroup.php.