---
title: Delete an alert policy
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/alerts/newrelic-alerts-delete-policy
---

The action identifier is `newrelic.alerts.deletePolicy`.

Deletes an existing alert policy. Deleting a policy also removes its association with any conditions that reference it.

## Inputs

The following table describes all available input fields for this action.

| Input         | Type   | Description                                                     | Example                                                                                  |
| ------------- | ------ | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| **accountId** | Int    | **Required.** The New Relic account that owns the policy.       | `123456`                                                                                 |
| **id**        | String | **Required.** The ID of the policy to delete.                   | `"2000002"`                                                                              |
| **selectors** | List   | **Optional.** JQ selectors to extract values from the response. | ```yaml selectors:   - name: deletedId     expression: ".data.alertsPolicyDelete.id" ``` |

## Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                                                                                                    |
| ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **success**      | Boolean | `true` when the step executed without error.                                                                                                   |
| **errorMessage** | String  | Error message on failure. `null` on success.                                                                                                   |
| **data**         | Map     | NerdGraph response containing the deleted policy's ID. ```json {   "data": {     "alertsPolicyDelete": {       "id": "2000002"     }   } } ``` |

## Example

The following example deletes an alert policy.

| Workflow example                                                                                                                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ```yaml name: delete_alert_policy description: Delete an alert policy steps:   - name: deletePolicy     type: action     action: newrelic.alerts.deletePolicy     version: 1     inputs:       accountId: ${{ .workflowInputs.accountId }}       id: ${{ .workflowInputs.policyId }}     next: end ``` |
