[comment]: # translation:outdated

[comment]: # ({5ebe3ff8-5ebe3ff8})
# hostgroup.create

[comment]: # ({/5ebe3ff8-5ebe3ff8})

[comment]: # ({new-06c5b0b6})
### Description

`object hostgroup.create(object/array hostGroups)`

This method allows to create new host groups.

::: noteclassic
This method is only available to *Super admin* user type.
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-06c5b0b6})

[comment]: # ({7c6d41ff-7c6d41ff})
### Parametri

`(object/array)` Gruppi host da creare. Il metodo accetta gruppi host
con le [proprietà del gruppo host standard](object#host_group).

[comment]: # ({/7c6d41ff-7c6d41ff})

[comment]: # ({e3c164f1-e3c164f1})
### Restituisce i valori

`(object)` Restituisce un oggetto contenente gli ID del gruppi host creato
nella proprietà `groupids`. L'ordine degli ID restituiti
corrisponde all'ordine dei gruppi host passati.

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

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

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

[comment]: # ({new-37cc26c2})
#### Creating a host group

Create a host group called "Linux servers".

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "hostgroup.create",
    "params": {
        "name": "Linux servers"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "groupids": [
            "107819"
        ]
    },
    "id": 1
}
```

[comment]: # ({/new-37cc26c2})

[comment]: # ({df4dc6d7-df4dc6d7})
### Fonte

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

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