# Delete an alert

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


[Idempotency Supported](/docs/api/idempotency)

Deletes an alert configuration. Only subscription-scoped alerts can be deleted using this endpoint.

**Important**

This operation cannot delete global alerts. To stop a global alert from firing, [update the alert](/docs/api/alerts/update-an-alert) and set `status` to `disabled` instead.

### Impacts

**

Alert configuration

**

The alert configuration is permanently deleted from the system and cannot be recovered.

**

Alert statuses

**

All [alert statuses](/docs/api/alert_statuses) associated with this alert are removed. No further evaluation takes place, and no `alert_status_changed` webhooks are fired for this alert going forward.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/alerts/alert___dev__3Nl7purV3LwbKYH/delete \
     -X POST  \
     -u {site_api_key}:
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Alert.Delete("alert___dev__3Nl7purV3LwbKYH").Request();

Alert alert = result.Alert;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    alertAction "github.com/chargebee/chargebee-go/v3/actions/alert"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := alertAction.Delete("alert___dev__3Nl7purV3LwbKYH").Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Alert := res.Alert
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.AlertDeleteRequest{
    Id : "alert___dev__3Nl7purV3LwbKYH",
}
  res, err := client.Alert.Delete(req)
      if err != nil {
        fmt.Println(err)
    } else {
        Alert := res.Alert
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = Alert.delete("alert___dev__3Nl7purV3LwbKYH").request();

        Alert alert = result.alert();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.alert.Alert;
import com.chargebee.v4.models.alert.params.AlertDeleteParams;
import com.chargebee.v4.models.alert.responses.AlertDeleteResponse;

public class AlertDelete {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        AlertDeleteResponse response = client.alerts().delete("alert___dev__3Nl7purV3LwbKYH");

        Alert alert = response.getAlert();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.alert.delete("alert___dev__3Nl7purV3LwbKYH");

    console.log(result);
    const alert = result.alert;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->alert()->delete("alert___dev__3Nl7purV3LwbKYH");
$alert = $result->alert;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Alert.delete("alert___dev__3Nl7purV3LwbKYH")
alert = response.alert
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::Alert.delete("alert___dev__3Nl7purV3LwbKYH")

alert = result.alert
```

## Sample Response

```json
{
  "alert": {
    "id": "alert___dev__3Nl7purV3LwbKYH",
    "name": "GPT-4o usage threshold",
    "description": "Notify when usage crosses 90% of quota",
    "type": "usage_exceeded",
    "metered_feature_id": "gpt4o-usage",
    "threshold": {
      "mode": "percentage",
      "value": 90
    },
    "filter_conditions": [
      {
        "field": "plan_price_id",
        "operator": "equals",
        "value": "enterprise"
      },
      {..}
    ],
    "subscription_id": null,
    "status": "enabled",
    "object": "alert",
    "resource_version": 1763879971000,
    "created_at": 1763879971,
    "updated_at": 1763879971
  }
}
```

## URL Format

**POST** https://[site].chargebee.com/api/v2/alerts/{alert-id}/delete

## Returns

- `alert` (Alert object)
  Resource object representing alert.
