Skip to main content

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: Delete on the alerts feature

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key for authentication
auth_tokenStringYes (or api_key)Auth token for authentication
app_idStringYesApplication identifier
alertIdStringYesAlert 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

FieldTypeDescription
resultStringStatus message confirming deletion

Error Responses

HTTP StatusError ResponseDescription
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 Delete permission on the shared alerts feature.
  • Converts alertId to a MongoDB ObjectID and removes the alert matching both _id=alertId and app=app_id.
  • On successful remove callback, writes an online_users_alert_deleted system log with the deleted alert_id.
  • The success response does not include a deleted count; an unmatched but syntactically valid alertId can still return Deleted 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
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.concurrent_users_alertsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.systemlogsAudit trailContains system action records used by this endpoint for audit output or audit writes.