---
notionId: "a8bfbe0c04ad4993a231488e3dd2f0f2"
product: "developer"
cluster: "apis"
intent: "developer.api-webhooks"
docSlug: "api-webhooks"
task: "Webhooks in the API"
title: "Webhooks in the API | VirtualPBX"
meta_description: "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"
answer: "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."
audience: "user"
updated: "2023-07-25"
legacy: ["webhooks"]
headings: [{"depth":2,"text":"About Webhooks","id":"about-webhooks"},{"depth":3,"text":"Webhook Types","id":"webhook-types"},{"depth":3,"text":"Webhook Schema","id":"webhook-schema"},{"depth":3,"text":"Webook Payload","id":"webook-payload"},{"depth":3,"text":"Payloads for Creating Webhooks","id":"payloads-for-creating-webhooks"},{"depth":3,"text":"Missed Calls Webhook","id":"missed-calls-webhook"},{"depth":3,"text":"New Voicemail Mail Message Webhook","id":"new-voicemail-mail-message-webhook"},{"depth":3,"text":"Create Webhook","id":"create-webhook"},{"depth":3,"text":"API","id":"api"},{"depth":3,"text":"Payload","id":"payload"},{"depth":3,"text":"List Webhooks","id":"list-webhooks"},{"depth":3,"text":"API","id":"api-1"},{"depth":3,"text":"Payload","id":"payload-1"},{"depth":3,"text":"Edit Webhook","id":"edit-webhook"},{"depth":3,"text":"API","id":"api-2"},{"depth":3,"text":"Payload","id":"payload-2"},{"depth":3,"text":"Delete Webhook","id":"delete-webhook"},{"depth":3,"text":"API","id":"api-3"}]
lint: []
---

## 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:

<ul>
<li><p>Channel Answer</p>
</li>
<li><p>Channel Bridge</p>
</li>
<li><p>Channel Create</p>
</li>
<li><p>Channel Destroy</p>
</li>
<li><p>Call Parking</p>
</li>
<li><p>Notifications Webhook</p>
</li>
</ul>

### 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.

<div class="table-scroll" tabindex="0"><table><tr><th>Key</th><th>Description</th><th>Type</th><th>Default</th><th>Required</th></tr><tr><td><code>custom_data</code></td><td>These properties will be added to the event and will overwrite existing values.</td><td><code>object()</code></td><td></td><td><code>false</code></td></tr><tr><td><code>enabled</code></td><td>Is the webhook enabled and running</td><td><code>boolean()</code></td><td><code>true</code></td><td><code>false</code></td></tr><tr><td><code>hook</code></td><td>The trigger event for a request being made to 'callback_uri'.</td><td><code>string()</code></td><td></td><td><code>true</code></td></tr><tr><td><code>http_verb</code></td><td>What HTTP method to use when contacting the server</td><td>`string('get'</td><td>'post')`</td><td><code>post</code></td></tr><tr><td><code>name</code></td><td>A friendly name for the webhook</td><td><code>string()</code></td><td></td><td><code>true</code></td></tr><tr><td><code>retries</code></td><td>Retry the request this many times (if it fails)</td><td><code>integer()</code></td><td><code>2</code></td><td><code>false</code></td></tr><tr><td><code>uri</code></td><td>The 3rd party URI to call out to an event</td><td><code>string()</code></td><td></td><td><code>true</code></td></tr></table></div>

### Webook Payload

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

Base Payload

<ul>
<li><p>hook_event: The type of hook being fired</p>
</li>
<li><p>call_direction: &quot;inbound&quot; or &quot;outbound&quot;, relative to Dash</p>
</li>
<li><p>timestamp: gregorian timestamp of the event</p>
</li>
<li><p>account_id: ID of the account generating the event</p>
</li>
<li><p>request: SIP Request</p>
</li>
<li><p>to: SIP To</p>
</li>
<li><p>from: SIP From</p>
</li>
<li><p>call_id: SIP Call ID</p>
</li>
<li><p>other_leg_call_id: If bridged, the Call-ID of the other leg</p>
</li>
<li><p>caller_id_name: Caller ID Name</p>
</li>
<li><p>caller_id_number: Caller ID Number</p>
</li>
<li><p>callee_id_name: Callee Name</p>
</li>
<li><p>callee_id_number: Callee Number</p>
Most of these fields should be present on all payloads.
Hook Specific</li>
<li><p>channel_create</p>
</li>
<li><p>channel_answer</p>
</li>
<li><p>channel_destroy</p>
</li>
</ul>

### Payloads for Creating Webhooks

### Missed Calls Webhook

<pre tabindex="0"><code class="language-json">{
   &quot;data&quot;:{
      &quot;name&quot;:&quot;Missed Call&quot;,
      &quot;hook&quot;:&quot;notifications&quot;,
      &quot;include_subaccounts&quot;:false,
      &quot;http_verb&quot;:&quot;get&quot;,
      &quot;retries&quot;:4,
      &quot;uri&quot;:&quot;https://hooks.zapier.com/hooks/catch/591668/xlwslm/&quot;,
      &quot;type&quot;:&quot;account&quot;,
      &quot;action&quot;:&quot;doc_created&quot;,
      &quot;custom_data&quot;:{
         &quot;type&quot;:&quot;missed_call&quot;
      },
      &quot;enabled&quot;:true,
      &quot;include_internal_legs&quot;:true,
      &quot;id&quot;:&quot;51840ffc8bde832a1f5477def32cd665&quot;
   }
}</code></pre>

### New Voicemail Mail Message Webhook

<pre tabindex="0"><code class="language-json">{
   &quot;data&quot;:{
      &quot;name&quot;:&quot;Missed Call&quot;,
      &quot;hook&quot;:&quot;notifications&quot;,
      &quot;include_subaccounts&quot;:false,
      &quot;http_verb&quot;:&quot;get&quot;,
      &quot;retries&quot;:4,
      &quot;uri&quot;:&quot;https://hooks.zapier.com/hooks/catch/591668/xlwslm/&quot;,
      &quot;type&quot;:&quot;account&quot;,
      &quot;action&quot;:&quot;doc_created&quot;,
      &quot;custom_data&quot;:{
         &quot;type&quot;:&quot;missed_call&quot;
      },
      &quot;enabled&quot;:true,
      &quot;include_internal_legs&quot;:true,
      &quot;id&quot;:&quot;51840ffc8bde832a1f5477def32cd665&quot;
   }
}</code></pre>

### Create Webhook

Creates a webhook using parameters passed in the payload.

### API

Method: PUT

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/webhooks</code></pre>

### Payload

<pre tabindex="0"><code class="language-json">{
  &quot;data&quot;: {
    &quot;name&quot;: &quot;My New Webhook&quot;,
    &quot;uri&quot;: &quot;http://my.server.net&quot;,
    &quot;http_verb&quot;: &quot;post&quot;,
    &quot;hook&quot;: &quot;channel_destroy&quot;,
    &quot;retries&quot;: 4
  }
}</code></pre>

### List Webhooks

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

### API

Method: GET

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/webhooks</code></pre>

### Payload

<pre tabindex="0"><code class="language-json">{
  &quot;data&quot;: {
    &quot;name&quot;: &quot;Main Blacklist&quot;,
    &quot;numbers&quot;: {
      &quot;+14154846048&quot;: {}
    }
  }
}</code></pre>

### Edit Webhook

Edit a webhook with any changes passed in the payload.

### API

Method: POST

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/webhooks/{{webhook_id}}</code></pre>

### Payload

<pre tabindex="0"><code class="language-json">{
  &quot;data&quot;: {
    &quot;enabled&quot;: true,
  &quot;retiees&quot;: 4
  }
}</code></pre>

### Delete Webhook

Delete a webhook. This is permanent and unrecoverable.

### API

Method: DELETE

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/webhooks/{{webhook_id}}</code></pre>

← Previous

[Quickcall](/2f1dac0ca82c4641a952227ed9c7a7ea)

Next →

[VirtualText API](/bff0ba0259754166818f502aa4df8f93)
