Concurrent Users - Delete Alert
Enterprise
This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.
Endpoint
/i/concurrent_alert/delete
Overview
Permanently remove an online user alert from your application. This stops all monitoring and notifications associated with the alert. The deletion is permanent and cannot be undone.
Authentication
Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.
Permissions
- Required permission:
Deleteon thealertsfeature
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes (or auth_token) | API key for authentication |
| auth_token | String | Yes (or api_key) | Auth token for authentication |
| app_id | String | Yes | Application identifier |
| alertId | String | Yes | Alert ObjectID to delete (MongoDB format) |
Examples
Example: Delete an alert
curl -X POST "https://your-server.com/i/concurrent_alert/delete" \
-d "api_key=YOUR_API_KEY" \
-d "app_id=YOUR_APP_ID" \
-d "alertId=507f1f77bcf86cd799439011"
Response
Success Response
{
"result": "Deleted an alert"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| result | String | Status message confirming deletion |
Error Responses
| HTTP Status | Error Response | Description |
|---|---|---|
| 200 | {\"result\": \"Failed to delete the alert\"} | Alert not found or deletion failed |
| 500 | {\"result\": \"Failed to delete the alert\"} | Database or server error during deletion |
Behavior
- Requires
Deletepermission on the sharedalertsfeature. - Converts
alertIdto a MongoDB ObjectID and removes the alert matching both_id=alertIdandapp=app_id. - On successful remove callback, writes an
online_users_alert_deletedsystem log with the deletedalert_id. - The success response does not include a deleted count; an unmatched but syntactically valid
alertIdcan still returnDeleted an alert. - Invalid ObjectID conversion or other synchronous delete failures return
Failed to delete the alert.
Limitations
- Alert deletion is permanent and cannot be undone
- Cannot batch delete multiple alerts in a single request
Related Endpoints
- Get Alerts - Retrieve alerts for an application
- Create or Update Alert - Create a new alert or modify existing one
- Update Alert Status - Enable or disable alerts
Implementation details
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.concurrent_users_alerts | Endpoint data source | Stores endpoint-related records this endpoint reads or modifies. |
countly.systemlogs | Audit trail | Contains system action records used by this endpoint for audit output or audit writes. |