Skip to main content

Concurrent Users - Update Alert Status

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/status

Overview

Enable or disable alerts in bulk to manage which alerts are active. Disabling temporarily suspends monitoring without deleting configuration, useful for maintenance windows. Enabling resets the alert's trigger state and start evaluation fresh.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

  • Required permission: Update 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
statusString (JSON)YesJSON map of alert ID to enabled state (true or false)

Examples

Example 1: Enable and disable multiple alerts

curl "https://your-server.com/i/concurrent_alert/status" \
-d "api_key=YOUR_API_KEY" \
-d "app_id=YOUR_APP_ID" \
-d 'status={"507f1f77bcf86cd799439011":true,"607f1f77bcf86cd799439022":false}'

Example 2: Disable all alerts for maintenance

curl "https://your-server.com/i/concurrent_alert/status" \
-d "api_key=YOUR_API_KEY" \
-d "app_id=YOUR_APP_ID" \
-d 'status={"507f1f77bcf86cd799439011":false,"507f1f77bcf86cd799439012":false}'

Response

Success Response

true

Response Fields

FieldTypeDescription
(response)BooleanAlways true on success; indicates status updates were applied

Error Responses

HTTP StatusError ResponseDescription
400{\"result\": \"Insufficient permissions\"}User lacks Update permission on alerts feature
500{\"result\": \"Concurrent users API error.\"}Server error during status update

Behavior

  • Request accepts a JSON map of alert IDs to boolean states: {"alert_id_1": true, "alert_id_2": false}
  • When enabling (true): Sets defined_at to current timestamp and clears last_triggered (restarts the alert)
  • When disabling (false): Only updates enabled field; preserves last_triggered
  • For metric-type alerts (type: "m" or type: "o"): Server refetches and updates internal cache records
  • All specified alerts are updated atomically; partial failures are not returned individually

Limitations

  • Maximum 1000 alert status changes per request
  • Disabling an alert does not clear its last_triggered timestamp (use delete and recreate to fully reset)
  • Non-existent alert IDs in the status map are silently ignored (no error returned)
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.concurrent_users_alertsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.