This document is for an older version of Kazoo (version 4.3) that is no longer supported. You should upgrade and read the current documentation.

Webhook

Send a custom webhook to your web server during the callflow.

The Webhook Callflow Action

Webhooks can be triggered from a callflow without needing them to be predefined by an API call. They are useful in tracking the state of a caller in a phone tree, triggering actions on the receiver’s end, or whatever imagination can come up with.

Schema

Validator for the webhook callflow data object

KeyDescriptionTypeDefaultRequiredSupport Level
custom_dataJSON object of custom data included on the HTTP requestobject()false
http_verbWhat HTTP verb to use when sending the request`string(‘post''get’)`false
retriesHow many times to retry the request if the host isn’t availableinteger()false
skip_moduleWhen set to true this callflow action is skipped, advancing to the wildcard branch (if any)boolean()false
uriThe HTTP URI to send the requeststring()false
An example JSON action
{"module":"webhook"
 ,"data":{
     "uri":"http://my.ser.ver/path/to/webhook/destination"
     ,"http_verb":"post"
     ,"custom_data":{
         "some_id":"123abc"
         ,"app":"my_cool_app"
     }
 }
}

Using the webhook action in a callflow

To receive a webhook anytime the main company number goes to voicemail instead of being answered, for instance:

{"numbers":["+10005559999"]
 ,"flow":{
     "module":"device"
     ,"data":{"id":"front_desk_device_id"}
     ,"children":{
         "_":{
             "module":"webhook"
             ,"data":{
                 "uri":"http://my.ser.ver/frontdesk/missed_call"
             }
             ,"children":{
                 "_":{
                     "module":"voicemail"
                     ,"data":{"id":"front_desk_voicemail_box_id"}
                 }
             }
         }
     }
 }
}

Now your web server will receive a webhook payload anytime the caller is sent to voicemail instead of talking to the front desk.

On this page