Create 2

POST https://api.pegasusgateway.com/triggers

Request Body

{"timezone"=>"America/New_York", "message"=>"This trigger will fire when the speed is greater than 80 and is inside a geofence", "category"=>"vehicle", "log"=>true, "type"=>"event", "rules"=>[{"operator"=>">", "value"=>80, "id"=>"rule-0", "key"=>"speed"}, {"operator"=>"entered_fence", "value"=>{"fences"=>[761]}, "id"=>"rule-1", "key"=>"lat"}], "active"=>true, "processes"=>[["email_event", {"destinations"=>["username@email.com"]}], ["consume_resource", {"resource"=>"http://www.somexternalapi.com/consume/resource", "method"=>"post", "headers"=>{"Content-Type"=>"application/json"}, "template"=>"{\"text\":\"hello world, this is vehicle {{object.name}}, traveling at {{body.mph}} mph, heading {{body.head}} degrees\"}"}]], "name"=>"New Trigger", "postfix"=>["rule-0", "rule-1", "and"], "vehicles"=>[953, 954, 955]}