> ## Documentation Index
> Fetch the complete documentation index at: https://thrackle.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# deleteRule

> **deleteRule**(`config`, `rulesEngineRulesContract`, `policyId`, `ruleId`): `Promise`\<`number`>

Deletes a rule from the rules engine component contract.

## Parameters

| Parameter                          | Type                                  | Description                                                  |
| ---------------------------------- | ------------------------------------- | ------------------------------------------------------------ |
| `config`                           | `Config`                              | -                                                            |
| `rulesEngineRulesContract`         | `object`                              | The contract instance containing the rules engine component. |
| `rulesEngineRulesContract.abi`     | (`object` \| `object` \| `object`)\[] | -                                                            |
| `rulesEngineRulesContract.address` | \`0x\$\{string}\`                     | -                                                            |
| `policyId`                         | `number`                              | The ID of the policy to which the rule belongs.              |
| `ruleId`                           | `number`                              | The ID of the rule to be deleted.                            |

## Returns

`Promise`\<`number`>

A promise that resolves to a number: - `0` if the rule was successfully deleted. - `-1` if an error occurred during the deletion process.

## Throws

This function does not throw errors directly but returns `-1` in case of an exception.

## Defined in

[src/modules/rules.ts:484](https://github.com/forte-service-company-ltd/forte-rules-engine-sdk/blob/5aad4d7c3c8cc91280e4449c17ac8ea31219fbed/src/modules/rules.ts#L484)
