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

# Delete an Alert

> Delete an alert (event subscription) and its delivery records through the Collate REST API or Python SDK.

# Delete an Alert

Delete an alert by ID or by name.

> [!NOTE]
>
> The Python examples on this page use the original client (`metadata.ingestion.ometa.ometa_api.OpenMetadata`) because SDK 2.0 (`metadata.sdk`) doesn't include alert operations. For more information, see [Which Python SDK Should I Use?](https://docs.getcollate.io/ai-2-0/developer-guide/sdk/python.md).

* By ID: `DELETE /v1/events/subscriptions/{id}`
* By name: `DELETE /v1/events/subscriptions/name/{name}`
* Asynchronously by ID: `DELETE /v1/events/subscriptions/async/{id}`

**id** `string` *required*

UUID of the alert.

> [!WARNING]
>
> Deletion is permanent. Collate removes the alert, stops its delivery process, and removes its delivery records. Alerts have no soft delete and no `hardDelete` option, so you can't restore a deleted alert.

```bash DELETE /v1/events/subscriptions/{id} theme={null}
curl -X DELETE "https://your-company.getcollate.io/api/v1/events/subscriptions/$ALERT_ID" \
  -H "Authorization: Bearer $TOKEN"
```

```python DELETE /v1/events/subscriptions/{id} theme={null}
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
    OpenMetadataConnection,
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import (
    OpenMetadataJWTClientConfig,
)
from metadata.generated.schema.events.eventSubscription import EventSubscription

server_config = OpenMetadataConnection(
    hostPort="https://your-company.getcollate.io/api",
    authProvider="openmetadata",
    securityConfig=OpenMetadataJWTClientConfig(jwtToken="<YOUR-JWT-TOKEN>"),
)
metadata = OpenMetadata(server_config)

alert = metadata.get_by_name(
    entity=EventSubscription,
    fqn="dq-failed-tests-to-webhook",
)
# Collate deletes alerts permanently, whatever the hard_delete value
metadata.delete(
    entity=EventSubscription,
    entity_id=str(alert.id.root),
    hard_delete=True,
)
```

## Permissions

The caller needs **Delete** permission on the alert.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.