[comment]: # ({94ac227e-94ac227e})
# iconmap.create

[comment]: # ({/94ac227e-94ac227e})

[comment]: # ({730f61ef-ac3800fa})
### Description

`object iconmap.create(object/array iconMaps)`

This method allows to create new icon maps.

::: 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/users/user_roles)
for more information.
:::

[comment]: # ({/730f61ef-ac3800fa})

[comment]: # ({99f08175-ca8671b9})
### Parameters

`(object/array)` Icon maps to create.

Additionally to the [standard icon map properties](object#icon-map), the
method accepts the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|mappings|array|[Icon mappings](/manual/api/reference/iconmap/object#icon-mapping) to be created for the icon map.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *required*|

[comment]: # ({/99f08175-ca8671b9})

[comment]: # ({9dbb2dc6-9dbb2dc6})
### Return values

`(object)` Returns an object containing the IDs of the created icon maps
under the `iconmapids` property. The order of the returned IDs matches
the order of the passed icon maps.

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

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

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

[comment]: # ({df976371-39a9c07f})
#### Create an icon map

Create an icon map to display hosts of different types.

[Request](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "iconmap.create",
    "params": {
        "name": "Type icons",
        "default_iconid": "2",
        "mappings": [
            {
                "inventory_link": 1,
                "expression": "server",
                "iconid": "3"
            },
            {
                "inventory_link": 1,
                "expression": "switch",
                "iconid": "4"
            }
        ]
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "iconmapids": [
            "2"
        ]
    },
    "id": 1
}
```

[comment]: # ({/df976371-39a9c07f})

[comment]: # ({ab16f1c6-8df05cf6})
### See also

-   [Icon mapping](object#icon-mapping)

[comment]: # ({/ab16f1c6-8df05cf6})

[comment]: # ({25aae98d-25aae98d})
### Source

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

[comment]: # ({/25aae98d-25aae98d})
