Skip to main content

Concurrent Users - Get Alerts

Endpoint

/o?method=concurrent_alerts

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Retrieve all online user alerts accessible to your user. Results include alerts configured for the application, filtering based on your permissions and visible apps. The response shows each alert's configuration, triggering status, and notification recipients.

Authentication

  • Authentication methods:
    • API Key (parameter): api_key=YOUR_API_KEY
    • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
    • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Required permission: Read on the Online Users feature (concurrent_users)

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key for authentication
auth_tokenStringYes (or api_key)Auth token for authentication
app_idStringYesApplication ID used by the read-permission validator before listing visible alerts

Configuration Impact

SettingDefaultAffectsUser-visible impact
concurrent_users.*Online Users feature defaultsLive-count and alert behavior for online-user endpoints.Changes to Online Users settings can alter alert handling, thresholds, or returned live metrics.

Response

Success Response

[
{
"_id": "5d4472152de8f07336f3b352",
"name": "High Online Users Peak",
"app": "5be987d7b93798516eb5289a",
"type": "t",
"enabled": true,
"def": "max",
"condition_title": "Online users exceed 5000",
"users": 5000,
"minutes": 5,
"email": ["admin@company.com", "ops@company.com"],
"created_by": "5d4472152de8f07336f3b100",
"createdByUser": "John Admin",
"last_triggered": 1567474533960,
"defined_at": 1564896097406,
"status": "ready"
}
]

Response Fields

FieldTypeDescription
_idString (ObjectID)Unique alert identifier
nameStringUser-friendly alert name
appStringApplication ID this alert monitors
typeStringAlert type: t (threshold), m (metric), o (offline)
enabledBooleanWhether the alert is currently active
defStringAlert definition: max (triggers on peak) or min (triggers on drop)
condition_titleStringHuman-readable description of alert condition
usersNumberThreshold count (for type t alerts)
minutesNumberTime window in minutes for evaluating the condition
emailArrayList of email addresses to notify
created_byStringObjectID of the member who created the alert
createdByUserStringFull name of the alert creator
last_triggeredNumberTimestamp (ms) of the last alert trigger; absent if never triggered
defined_atNumberTimestamp (ms) when alert was created or last modified
statusStringAlert status: ready (operational), other values indicate processing state

Error Responses

HTTP StatusError ResponseDescription
400{\"result\": \"Insufficient permissions\"}User lacks Read permission on feature
500{\"result\": \"Concurrent users API error.\"}Server error in alert retrieval

Behavior/Processing

  • Requires Read permission on concurrent_users.
  • Reads alerts from concurrent_users_alerts using the same visibility filter as the Online Users feature. Global admins can see all alerts; other users only see alerts for visible apps.
  • Returns only alert configuration fields selected by the handler: _id, name, app, def, users, minutes, email, enabled, condition_title, type, created_by, alertBy, and allGroups.
  • Loads members and enriches each alert with createdByUser by matching created_by to the member _id.
  • Does not paginate in the handler; the full visible alert list is returned.
  • Database/read errors return Concurrent users API error..

Database Collections

CollectionUsed forData touched by this endpoint
countly.concurrent_users_alertsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.membersMember/account enrichmentStores member profile fields (for example names/IDs) used to resolve actor metadata.

Limitations

  • Results filtered by user permissions: global admins see all alerts; others see only alerts for apps they have access to
  • Maximum 1000 alerts returned in a single request
  • Alert definitions cannot be modified after creation; must delete and recreate to change type
  • last_triggered field only appears if the alert has fired at least once

Examples

Example: List all accessible alerts

curl "https://your-server.com/o?method=concurrent_alerts" \
-d "api_key=YOUR_API_KEY" \
-d "app_id=YOUR_APP_ID"

Example: List alerts with auth token header

curl -H "countly-token: YOUR_AUTH_TOKEN" \
"https://your-server.com/o?method=concurrent_alerts&app_id=YOUR_APP_ID"

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Last Updated: 2026-04-18


Last Updated

2026-02-16