[comment]: # ({0ae84d72-ecea3b29})
# discoveryruleprototype.create

[comment]: # ({/0ae84d72-ecea3b29})

[comment]: # ({36f3c2f8-00b2cce0})
### Description

`object discoveryruleprototype.create(object/array lldRules)`

This method allows to create new LLD rule prototypes.

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

[comment]: # ({/36f3c2f8-00b2cce0})

[comment]: # ({ed2edd1b-8c04f31d})
### Parameters

`(object/array)` LLD rule prototypes to create.

Additionally to the [standard LLD rule prototype properties](object#lld-rule-prototype), the
method accepts the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|filter|object|[LLD rule prototype filter](/manual/api/reference/discoveryruleprototype/object#lld-rule-filter) for the LLD rule.|
|preprocessing|object/array|[LLD rule prototype preprocessing](/manual/api/reference/discoveryruleprototype/object#lld-rule-preprocessing) options.|
|lld\_macro\_paths|object/array|LLD rule prototype [lld\_macro\_path](/manual/api/reference/discoveryruleprototype/object#lld-macro-path) options.|
|overrides|object/array|[LLD rule prototype overrides](/manual/api/reference/discoveryruleprototype/object#lld-rule-overrides) options.|

[comment]: # ({/ed2edd1b-8c04f31d})

[comment]: # ({42d06e60-e0c3122b})
### Return values

`(object)` Returns an object containing the IDs of the created LLD rule prototypes
under the `itemids` property. The order of the returned IDs matches the
order of the passed LLD rule prototypes.

[comment]: # ({/42d06e60-e0c3122b})

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

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

[comment]: # ({2f248d04-26450b92})
#### Creating an LLD rule prototype

Create an LLD rule prototype (Type: Nested) to discover tablespaces in database instance.

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

```json
{
    "jsonrpc": "2.0",
    "method": "discoveryruleprototype.create",
    "params": {
        "name": "Discover tablespaces for {#DB}",
        "key_": "db.tablespace.discovery[{#DB}]",
        "hostid": "10084",
        "ruleid": "47251",
        "type": 23
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "itemids": [
            "47252"
        ]
    },
    "id": 1
}
```

[comment]: # ({/2f248d04-26450b92})

[comment]: # ({72853784-4dc2b1ef})
### See also

-   [LLD rule prototype filter](object#lld-rule-prototype-filter)
-   [LLD macro paths](object#lld-macro-path)
-   [LLD rule prototype preprocessing](object#lld-rule-prototype-preprocessing)

[comment]: # ({/72853784-4dc2b1ef})

[comment]: # ({91cce031-612c1fea})
### Source

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

[comment]: # ({/91cce031-612c1fea})
