Skip to content

Update specific Alert

Request

PUT /v3/alerts/{alertId}
Security
API_Key
Path
alertIdinteger, (int64)required
Bodyapplication/json
namestring, non-emptyrequired

User-defined name of the alert

labelsArray of integers

Passing null instead of this array while updating an entity will prevent API from changing associated labels

metricTypestringrequired

Deprecated metric types:

  • ACCOUNT_USAGE_THIS_MONTH_AUDIT_PAGE_SCANNED_COUNT
  • ACCOUNT_USAGE_12_MONTH_AUDIT_PAGE_SCANNED_COUNT
  • ACCOUNT_USAGE_12_MONTH_WJ_RUN_COUNT
  • ACCOUNT_USAGE_THIS_MONTH_WJ_RUN_COUNT
  • ACCOUNT_USAGE_LAST_30_DAYS_LOGIN_USER_COUNT
  • PAGE_SUMMARY_FAILED_RULE_COUNT
Enum:"ACCOUNT_USAGE_THIS_MONTH_AUDIT_PAGE_SCANNED_COUNT""ACCOUNT_USAGE_12_MONTH_AUDIT_PAGE_SCANNED_COUNT""ACCOUNT_USAGE_12_MONTH_WJ_RUN_COUNT""ACCOUNT_USAGE_THIS_MONTH_WJ_RUN_COUNT""ACCOUNT_USAGE_LAST_30_DAYS_LOGIN_USER_COUNT""ACCOUNT_USAGE_V2_THIS_MONTH_AUDIT_PAGE_USAGE_PERCENTAGE""ACCOUNT_USAGE_V2_CURRENT_TERM_PAGE_USAGE_PERCENTAGE""ACCOUNT_USAGE_V2_CURRENT_TERM_WJ_RUN_USAGE_PERCENTAGE""ACCOUNT_USAGE_V2_THIS_MONTH_WJ_RUN_USAGE_PERCENTAGE""ACCOUNT_USAGE_V2_LAST_30_DAYS_LOGIN_USER_COUNT"
metricChangeTypestring

Behaviour per type:

  • VALUE_CHANGE: current - previous
  • VALUE_CHANGE_ABS: ABS(current - previous)
  • RELATIVE_VALUE_CHANGE: 100% * (current - previous) / previous
  • RELATIVE_VALUE_CHANGE: ABS(100% * (current - previous) / previous)

Composite metric change operators shown on ObservePoint UI should be defined as described below:

  • Changes by (∆) = VALUE_CHANGE_ABS + GREATER_OR_EQUAL(positive number)
  • Increases by (+) = VALUE_CHANGE + GREATER_OR_EQUAL(positive number)
  • Decreases by (-) = VALUE_CHANGE + LESS_OR_EQUAL(negative number)
  • Any change = VALUE_CHANGE_ABS (or VALUE_CHANGE) + NOT_EQUAL(0)
  • Changes by (∆ %) = RELATIVE_CHANGE_ABS + GREATER_OR_EQUAL(positive number)
  • Increases by (+%) = RELATIVE_CHANGE + GREATER_OR_EQUAL(positive number)
  • Decreases by (-%) = RELATIVE_CHANGE + LESS_OR_EQUAL(negative number)
Enum:"VALUE_CHANGE""VALUE_CHANGE_ABS""RELATIVE_VALUE_CHANGE""RELATIVE_VALUE_CHANGE_ABS"
targetValueComparatorobjectrequired
filtersV0objectrequired

Filters to be applied before computing the alert. Exact type depends on metricType, see mapping in AlertMetricTypeToFilterMapping

emailsArray of strings

List of email addresses that receive notifications when alert triggers. Will be replaced with Notification Profiles

customAlertMessagestring
notificationPolicystring

Behaviour per type:

  • WHEN_NEWLY_TRIGGERED: (default) send alert when goes from "ok" to "triggered" (resets when no longer triggered)
  • ALWAYS_WHEN_TRIGGERED: send alert notification each time it is triggered per run
Enum:"WHEN_NEWLY_TRIGGERED""ALWAYS_WHEN_TRIGGERED"
isDefaultForNewDataSourcesboolean

Makes this alert selected by default in data-source (audit/WJ) creation UI. This is a user-specific flag.

assignmentsArray of objects

Passing null instead of this array while updating an alert will prevent API from changing its assignments. To pass only updates of assignments (additions/removals) for existing alert use PATCH /v3/alerts/{alertId}/target-items endpoint

skipSendingAlertSharedWithYouEmailboolean

When TRUE, "Alert shared with you" email will NOT be sent to newly added email addresses. When NOT specified or FALSE, it will be sent.

PUT
/v3/alerts/{alertId}
curl -i -X PUT \
  'https://api.observepoint.com/v3/alerts/{alertId}' \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "labels": [
      223
    ],
    "metricType": "ACCOUNT_USAGE_THIS_MONTH_AUDIT_PAGE_SCANNED_COUNT",
    "metricChangeType": "VALUE_CHANGE",
    "targetValueComparator": {
      "operator": "GREATER",
      "targetValue": 0.1
    },
    "filtersV0": {},
    "emails": [
      "user@example.com"
    ],
    "customAlertMessage": "string",
    "notificationPolicy": "WHEN_NEWLY_TRIGGERED",
    "isDefaultForNewDataSources": true,
    "assignments": [
      {
        "itemType": "AUDIT",
        "itemId": 0
      }
    ],
    "skipSendingAlertSharedWithYouEmail": true
  }'

Responses

updated successfully

Response
No content