You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.



object hostinterface.replacehostinterfaces(object parameters)

This method allows to replace all host interfaces on a given host.

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 ID of the host to be updated and the new host interfaces.

Parameter Type Description
interfaces object/array Host interfaces to replace the current host interfaces with.

Parameter behavior:
- required
hostid ID ID of the host to be updated.

Parameter behavior:
- required

Return values

(object) Returns an object containing the IDs of the created host interfaces under the interfaceids property.


Replacing host interfaces

Replace all host interfaces with a single agent interface.


           "jsonrpc": "2.0",
           "method": "hostinterface.replacehostinterfaces",
           "params": {
               "hostid": "30052",
               "interfaces": {
                   "dns": "",
                   "ip": "",
                   "main": 1,
                   "port": "10050",
                   "type": 1,
                   "useip": 1
           "id": 1


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

See also


CHostInterface::replaceHostInterfaces() in ui/include/classes/api/services/CHostInterface.php.