Alerts webhook

Alerts webhooks are triggered when anomalies are detected in your project. For more information, see Anomalies dectection.

Setting up Alerts webhooks

To set up an Alerts webhook:

POST /api/v1/webhooks
BODY: {
  "url": "https://some-url.com",
  "type": "alerts",
  "secret": "some-secret"    //optional
}

When an anomaly is triggered, you receive awebhook response with an alertType. The table below contains all possibilities for alertType and value:

Alert typeResponse typeTypeValueDescription
Anomaly thresholdeventThresholdAbsoluteeventeventsCountAlerted if anomalies fall outside the predefined anomalies threshold
Relative percentage changeeventThresholdRelativeeventeventsCountAlerted if the conversion rate falls outside of the predefined percentage threshold
Automatic detectioneventAutomaticeventdistanceAlerted when changes in the ratio of total event occurrences of daily visitors from the previous day compared to the average of the previous seven days falls out of the .95 confidence percentile (approximately: mean +/- 2* standard deviations)
Anomaly thresholdfunnelThresholdAbsolutefunnelconversionRateAlerted if anomalies fall outside the predefined anomalies threshold
Relative percentagefunnelThresholdRelativefunnelconversionRateAlerted if the conversion rate falls outside of the predefined percentage threshold

An example response:

{
    "type": "alerts.<alertType>",
    "timestamp": Date,
    "project": {
        "id": String,
        "name": String
    },
    "organization": {
        "id": String,
        "name": String
    },
    "data": {
			"target": {
				"name": String,
				"type": "event" | "funnel",
				"id": String,
				"url": String
			},
			"direction": String,
			"threshold": Number,
			"value": Number,
			"date": Date
    }
}