[comment]: # ({edb56cfa-edb56cfa})
# usermacro.delete

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

[comment]: # ({f8ec4dea-f8ec4dea})
### Description

`object usermacro.delete(array hostMacroIds)`

This method allows to delete host macros.

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

[comment]: # ({dd1b319f-dd1b319f})
### Parameters

`(array)` IDs of the host macros to delete.

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

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

`(object)` Returns an object containing the IDs of the deleted host
macros under the `hostmacroids` property.

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

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

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

[comment]: # ({b2f5bee1-b2f5bee1})
#### Deleting multiple host macros

Delete two host macros.

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "usermacro.delete",
    "params": [
        "32",
        "11"
    ],
    "auth": "3a57200802b24cda67c4e4010b50c065",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "hostmacroids": [
            "32",
            "11"
        ]
    },
    "id": 1
}
```

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

[comment]: # ({1c2c5808-9d01c95a})
### Source

CUserMacro::delete() in
*frontends/php/include/classes/api/services/CUserMacro.php*.

[comment]: # ({/1c2c5808-9d01c95a})
