Skip to main content

Rules

An alert’s rules decide which entities trigger it, by tag.
"rules": {
  "operator": "AND",
  "tagRules": [
    { "tagId": "<uuid>", "mode": "INCLUDE" },
    { "tagId": "<uuid>", "mode": "EXCLUDE" }
  ],
  "checkLevel": "PRODUCT"
}
FieldMeaning
operatorAND (all tag rules must hold) or OR (any).
tagRulesOne or more { tagId, mode } entries; at least one required.
modeINCLUDE (tag must be present) or EXCLUDE (must be absent).
checkLevel(optional) The level the rules are evaluated at: SHOP, BRAND, PRODUCT, VARIANT, INVENTORY_ITEM. Omit it for no level restriction.
To alert on a metric threshold, first create a tagging rule that tags the matching entities, then reference that tag here with mode: "INCLUDE".

Perimeter (scope)

scope narrows which part of the catalog the alert covers. Every dimension is optional; an empty/absent one means “no restriction”.
"scope": {
  "storesIds": ["<uuid>"],
  "brandIds": ["<uuid>"],
  "productIds": [],
  "taxonomies": [ { "type": "SIZE", "values": ["S", "M"] } ],
  "collections": ["<uuid>"]
}
FieldRestricts to
storesIdsSpecific shops.
brandIdsSpecific brands.
productIdsSpecific products.
taxonomiesDimension values — each { type, values } (e.g. SIZE, COLOR, CATEGORY).
collectionsSpecific collections.

Trigger types

When an instance is raised, it carries a trigger type describing why:
Trigger typeMeaning
THRESHOLD_REACHEDThe condition is met now.
THRESHOLD_APPROACHINGThe condition is being approached (an approach_percentage is recorded on the instance).
FORECASTED_THRESHOLDA forecast predicts the condition will be met.

Condition operators (reference)

The metric comparison operators — used by the tagging-rule metric conditions that feed alert tags — are: LOWER_THAN, LOWER_OR_EQUAL, GREATER_THAN, GREATER_OR_EQUAL, EQUAL, NOT_EQUAL, plus the percentiles TOP_PERCENT / BOTTOM_PERCENT. Percentile operators are evaluated by the data platform (a percent_rank() window over the scoped population).
The scalar operators apply at row level; the two percentile operators only make sense across a population, so they’re resolved on the data platform.