[comment]: # translation:outdated

[comment]: # ({2a0a5084-2a0a5084})
# host.massremove

[comment]: # ({/2a0a5084-2a0a5084})

[comment]: # ({new-9c943195})
### Description

`object host.massremove(object parameters)`

This method allows to remove related objects from multiple hosts.

::: noteclassic
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](/manual/web_interface/frontend_sections/administration/user_roles)
for more information.
:::

[comment]: # ({/new-9c943195})

[comment]: # ({new-689d39a3})
### Parameters

`(object)` Parameters containing the IDs of the hosts to update and the
objects that should be removed.

|Parameter|[Type](/manual/api/reference_commentary#data_types)|Description|
|---------|---------------------------------------------------|-----------|
|**hostids**<br>(required)|string/array|IDs of the hosts to be updated.|
|groupids|string/array|Host groups to remove the given hosts from.|
|interfaces|object/array|Host interfaces to remove from the given hosts.<br><br>The host interface object must have the `ip`, `dns` and `port` properties defined.|
|macros|string/array|User macros to delete from the given hosts.|
|templateids|string/array|Templates to unlink from the given hosts.|
|templateids\_clear|string/array|Templates to unlink and clear from the given hosts.|

[comment]: # ({/new-689d39a3})

[comment]: # ({d166b99b-d166b99b})
### Повернуті значення

`(object)` Повертає об’єкт, що містить ідентифікатори оновлених хостів у властивості `hostids`.

[comment]: # ({/d166b99b-d166b99b})

[comment]: # ({b41637d2-b41637d2})
### Приклади

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({476c58e8-8c635a7b})
#### Роз'єднання шаблонів

Від’єднайте шаблон від двох хостів і видаліть усі шаблонні сутності.

Запит:

```json
{
    "jsonrpc": "2.0",
    "method": "host.massremove",
    "params": {
        "hostids": ["69665", "69666"],
        "templateids_clear": "325"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Відповідь:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "hostids": [
            "69665",
            "69666"
        ]
    },
    "id": 1
}
```

[comment]: # ({/476c58e8-8c635a7b})

[comment]: # ({abd9a8d3-abd9a8d3})
### Дивись також

- [host.update](оновити)
- [Макрос користувача](/manual/api/reference/usermacro/object#hosttemplate_level_macro)
- [Інтерфейс хоста](/manual/api/reference/hostinterface/object#host_interface)

[comment]: # ({/abd9a8d3-abd9a8d3})

[comment]: # ({bda21fe6-bda21fe6})
### Джерело

CHost::massRemove() в *ui/include/classes/api/services/CHost.php*.

[comment]: # ({/bda21fe6-bda21fe6})
