Alerts & Webhooks
Alert Types
11min
the following alert (aka notification) types can be created using the alerts ui dashboard https //ui amberflo io/alerts or create a notification docid\ f6y3dmmq5u0ffdwbcxkjq usage usage is a scheduled alert specify using a cron expression ( some cron examples https //crontab guru/examples html ) set the range ( hour , day , week , month ) select the meter by setting the meterid it can found by calling the \[meter definition api] ( get a list of meters docid\ x5xqe2kity cqxxzacqau ) or ui dashboard https //ui amberflo io/meters select the thresholdcondition and set the thresholdvalue when the trigger condition is evaluated at the scheduled time, it will evaluate the condition against the current meter usage by calling the query the usage data docid\ smvdzw1fyu6jwyl5ufqrd if the condition is true for a customer, then it will fire an alert curl location request post 'https //app amberflo io/notification' \\ \ header 'content type application/json' \\ \ header 'x api key xyz' \\ \ data raw '{ "name" "usage alert", "meterid" "4d1ca680 4974 11ec ad9b e1ce3f8b2ad3", "cron" "0 0 0", "webhookurl" "https //hooks slack com/services/t01hzb7a0m6/b01n83nqv6h/lma2syqdunv3a7clbbd9v3223", "email" "batman\@amberflo io", "thresholdcondition" "greater than", "thresholdvalue" "1000", "range" "day", "customerfiltermode" "per customer", "enabled" false }' prepaid credits this is a real time alert which applies to prepaid customers only it fires an alert if a customer's prepaid credits are depleted so they can buy more credits set the prepaid limit thresholdvalue the thresholdcondition is always less than the range or time bucket is always the current billing cycle if the current prepaid value on the active invoice in the current billing cycle is below the thresholdvalue for a customer, then it will fire an alert curl location request post 'https //app amberflo io/notification' \\ \ header 'content type application/json' \\ \ header 'x api key xyz' \\ \ data raw '{ "name" "alert for prepaid", "notificationtype" "prepaid", "email" \["batman\@gmail com", "batman\@wayne io"], "webhookurl" "https //hooks slack com/services/t01hzb7a0m6/b01p3j0le0h/obrott8tmrj2zbv3bqaqh88", "thresholdvalue" "1000", "customerfiltermode" "per customer", "enabled" true }' invoice this is a real time alert which applies to customers with billing enabled by assigning them a pricing plan set the invoice total limit thresholdvalue the thresholdcondition is always greater than the range or time bucket is always the current billing cycle and applies to the active invoice if the current invoice total in the current billing cycle exceeds the thresholdvalue , then it will fire an alert curl location request post 'https //app amberflo io/notification' \\ \ header 'content type application/json' \\ \ header 'x api key xyz' \\ \ data raw '{ "name" "invoice tracker", "notificationtype" "invoice", "email" \["batman\@wayne io"], "thresholdvalue" "500", "customerfiltermode" "per customer", "enabled" true }' product item usage limit this is a real time alert which only applies to invoices having product items breakdown product items are linked to meters this alert tracks the quantity or meter units for that meter as shown below on an invoice select the meter by setting the meterid it can found by calling the get a list of meters docid\ x5xqe2kity cqxxzacqau or ui dashboard https //ui amberflo io/meters select the pricing plan by setting the productplanid this can be obtained from the get detailed information about your billing cloud docid 3htq lyccp0bk2p yhog or ui dashboard https //ui amberflo io/billing cloud/pricing plans set the meter units limit thresholdvalue the thresholdcondition is always greater than the range or time bucket is always the current billing cycle if the meter units or quantity on the current invoice for the selected meter and pricing plan exceeds the thresholdvalue , then it will fire an alert curl location request post 'https //app amberflo io/notification' \\ \ header 'content type application/json' \\ \ header 'x api key xyz' \\ \ data raw '{ "name" "product item units tracker", "notificationtype" "product item units", "productplanid" "ff9c55a9 4796 480f ab77 2ae943ae1700", "email" \["batman\@wayne io"], "thresholdvalue" "100", "customerfiltermode" "per customer", "meterid" "21b71110 ee51 11ec ad99 5b1b04dba7a5", "enabled" true }' product item charge amount this is the same as product item usage limit , except it tracks the product item total charge on the current invoice instead of the meter units select the meter by setting the meterid it can found by calling the get a list of meters docid\ x5xqe2kity cqxxzacqau or ui dashboard https //ui amberflo io/meters select the pricing plan by setting the productplanid this can be obtained from the get detailed information about your billing cloud docid 3htq lyccp0bk2p yhog or ui dashboard https //ui amberflo io/billing cloud/pricing plans set the product item charge limit thresholdvalue the thresholdcondition is always greater than the range or time bucket is always the current billing cycle if the total product item total charge on the current invoice for the selected meter and pricing plan exceeds the thresholdvalue , then it will fire an alert curl location request post 'https //app amberflo io/notification' \\ \ header 'content type application/json' \\ \ header 'x api key xyz' \\ \ data raw '{ "name" "product item price tracker", "notificationtype" "product item price", "productplanid" "ff9c55a9 4796 480f ab77 2ae943ae1700", "email" \["batman\@wayne io"], "thresholdvalue" "200", "customerfiltermode" "per customer", "meterid" "21b71110 ee51 11ec ad99 5b1b04dba7a5", "enabled" true }' undefined customer this is a scheduled alert triggered when some ingested records reference a customer that has not been defined in amberflo note that there is a cool down period of one hour between alerts of this type curl location request post 'https //app amberflo io/notification' \\ \ header 'content type application/json' \\ \ header 'x api key xyz' \\ \ data raw '{ "name" "undefined customer", "notificationtype" "undefined customer", "email" \["batman\@wayne io"] }' undefined meter this is a scheduled alert triggered when some ingested records reference a meter that has not been defined in amberflo note that there is a cool down period of one hour between alerts of this type curl location request post 'https //app amberflo io/notification' \\ \ header 'content type application/json' \\ \ header 'x api key xyz' \\ \ data raw '{ "name" "undefined meter", "notificationtype" "undefined meter", "email" \["batman\@wayne io"] }'