Help Center / Developer / APIs / Webhooks

APIs

Webhooks in the API

Webhooks let the Dash API notify a third-party server when something happens in the account. Dash sends an HTTP request for a new call, an answered call, or a finished call, and later event types can be added the same way. Create a webhook with the payload for the event you want, including a missed-call webhook. The server should answer those requests and read the fields in the webhook schema.

On this page

About Webhooks

Webhooks allow Dash to send HTTP requests to a third-party web server, alerting that server of events occurring within Dash. Typically, events would be fired for new calls, when a call is answered, and when a call is finished, though other events will be added in the future.

Webhook Types

The following Webhooks are available on all Dash accounts:

  • Channel Answer

  • Channel Bridge

  • Channel Create

  • Channel Destroy

  • Call Parking

  • Notifications Webhook

Webhook Schema

Webhooks are subscriptions to allowed events that, when the event occurs, the event data is sent to the URI set in the Webhook document.

KeyDescriptionTypeDefaultRequired
custom_dataThese properties will be added to the event and will overwrite existing values.object()false
enabledIs the webhook enabled and runningboolean()truefalse
hookThe trigger event for a request being made to 'callback_uri'.string()true
http_verbWhat HTTP method to use when contacting the server`string('get''post')`post
nameA friendly name for the webhookstring()true
retriesRetry the request this many times (if it fails)integer()2false
uriThe 3rd party URI to call out to an eventstring()true

Webook Payload

Here’s what you can expect to receive when a webhook fires to your server:

Base Payload

  • hook_event: The type of hook being fired

  • call_direction: "inbound" or "outbound", relative to Dash

  • timestamp: gregorian timestamp of the event

  • account_id: ID of the account generating the event

  • request: SIP Request

  • to: SIP To

  • from: SIP From

  • call_id: SIP Call ID

  • other_leg_call_id: If bridged, the Call-ID of the other leg

  • caller_id_name: Caller ID Name

  • caller_id_number: Caller ID Number

  • callee_id_name: Callee Name

  • callee_id_number: Callee Number

    Most of these fields should be present on all payloads. Hook Specific
  • channel_create

  • channel_answer

  • channel_destroy

Payloads for Creating Webhooks

Missed Calls Webhook

{
   "data":{
      "name":"Missed Call",
      "hook":"notifications",
      "include_subaccounts":false,
      "http_verb":"get",
      "retries":4,
      "uri":"https://hooks.zapier.com/hooks/catch/591668/xlwslm/",
      "type":"account",
      "action":"doc_created",
      "custom_data":{
         "type":"missed_call"
      },
      "enabled":true,
      "include_internal_legs":true,
      "id":"51840ffc8bde832a1f5477def32cd665"
   }
}

New Voicemail Mail Message Webhook

{
   "data":{
      "name":"Missed Call",
      "hook":"notifications",
      "include_subaccounts":false,
      "http_verb":"get",
      "retries":4,
      "uri":"https://hooks.zapier.com/hooks/catch/591668/xlwslm/",
      "type":"account",
      "action":"doc_created",
      "custom_data":{
         "type":"missed_call"
      },
      "enabled":true,
      "include_internal_legs":true,
      "id":"51840ffc8bde832a1f5477def32cd665"
   }
}

Create Webhook

Creates a webhook using parameters passed in the payload.

API

Method: PUT

https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/webhooks

Payload

{
  "data": {
    "name": "My New Webhook",
    "uri": "http://my.server.net",
    "http_verb": "post",
    "hook": "channel_destroy",
    "retries": 4
  }
}

List Webhooks

List all webhooks on the account. Any webhooks with disable_reason, in summary, have been auto-disabled.

API

Method: GET

https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/webhooks

Payload

{
  "data": {
    "name": "Main Blacklist",
    "numbers": {
      "+14154846048": {}
    }
  }
}

Edit Webhook

Edit a webhook with any changes passed in the payload.

API

Method: POST

https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/webhooks/{{webhook_id}}

Payload

{
  "data": {
    "enabled": true,
  "retiees": 4
  }
}

Delete Webhook

Delete a webhook. This is permanent and unrecoverable.

API

Method: DELETE

https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/webhooks/{{webhook_id}}

← Previous

Quickcall

Next →

VirtualText API