This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.
Table of Contents

delete()

Available since version: 1.8
This function allows you to delete information about one or several hosts. All host-related information will be removed including items, graphs, macros, application, historical data, etc.

Parameters

Array of Host IDs

Returns

Parameter Description
result Operation successful. Result will contain array of deleted Host IDs.
error In case of any errors

Example

Delete hosts by Host ID

{
       "jsonrpc":"2.0",
       "method":"host.delete",
       "params":[
             {
                "hostid":"107824"
             },
             {
                "hostid":"107825"
             }
       ],
       "auth":"3a57200802b24cda67c4e4010b50c065",
       "id":2
       }
Copy
✔ Copied

Hosts deleted successfully:

{
       "jsonrpc":"2.0",
       "result":{
          "hostids": ["107824", "107825"]
       },
       "id":2
       }
Copy
✔ Copied

Host does not exist:

{
       "jsonrpc":"2.0",
       "error":{
             "code":-32500,
             "message":"Application error.",
             "data":"[ CHost::delete ] Host does not exist"
       },
       "id":2
       }
Copy
✔ Copied
To toggle search highlight, press Ctrl+Alt+H
Have an improvement suggestion for this page? Select the text that could be improved and press Ctrl+Enter to send it to the editors.