Skip to main content

Alerts - Update Status

Endpoint

/i/alert/status

Overview

Bulk updates enabled status for one or more alerts.

Authentication

Countly API supports three authentication methods:

  1. API key query parameter: api_key=YOUR_API_KEY
  2. Auth token query parameter: auth_token=YOUR_AUTH_TOKEN
  3. Auth token header: countly-token: YOUR_AUTH_TOKEN

Permissions

Requires alerts Update permission.

Request Parameters

ParameterTypeRequiredDescription
statusJSON String (Object)YesJSON-stringified map of alertID -> enabledBoolean.
app_idStringConditionalRequired for non-global-admin users during update validation.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

status Object Structure

Decoded example:

{
"65f0cbf8bca6b8e8fbf7f901": true,
"65f0cbf8bca6b8e8fbf7f902": false
}

Response

Success Response

true

Response Fields

FieldTypeDescription
(root value)Booleantrue after batch update promise resolves.

Error Responses

  • 400
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • 401
{
"result": "No app_id provided"
}
  • 401
{
"result": "User does not exist"
}
  • 401
{
"result": "User does not have right"
}
  • 500
{
"result": "Failed to change alert statusMongoServerError: write conflict"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Bulk updateValid status JSON mapBuilds per-alert updates and applies enabled value using findAndModify operations.Raw boolean true
Parse failureInvalid JSON in statusStops before DB writes.Wrapped error message

Impact on Other Data

  • Invalidates alerts cache so status changes are used by alert processor.
  • For non-global-admin users, updates are scoped to alerts with createdBy=current_user.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission checksReads member account and access rights for update validation.
countly.appsApp validation/context loadingValidates app_id for non-global-admin update access.
countly.alertsAlert rule persistenceUpdates enabled field on matching alerts.

Examples

Enable and disable alerts in one request

/i/alert/status?
app_id=6991c75b024cb89cdc04efd2&
api_key=YOUR_API_KEY&
status={
"65f0cbf8bca6b8e8fbf7f901":true,
"65f0cbf8bca6b8e8fbf7f902":false
}

Limitations

  • Endpoint returns true even if some IDs do not match any alert (no per-ID status is returned).
  • Invalid alert IDs can fail ObjectId conversion during processing.

Last Updated

2026-02-17