Create a webhook subscription

The following endpoint will create a webhook based on the service, event and eventfilters provided.

WebhookRequest object

PropertyTypeDescriptionRequired

signingKey

string

Set your own signing key to validate webhooks

Yes

event

string

The event you are subscribing to

Yes

eventFilters[]

object

Event filters are inclusive, which means you will only get events for filters you add

eventFilters.key

string

Event filters are inclusive e.g. adding a key and value will mean getting events for that value

Yes

eventFilters.value

string

The filter value.

Yes

service

string

The service that will be sending the webhooks.

url

string

A valid HTTPS endpoint to receive the webhooks

Yes

template

string

Will use a specific template for the webhook body

Currently, several subscriptions can be created.

Please examine the examples provided below.

For voice.outbound:

{
  "service": "channels",
  "event": "voice.outbound",
  "url": "https://yoururl.com",
  "signingKey": "mysecretkey",
  "eventFilters": []
}

For voice.inbound:

{
  "service": "channels",
  "event": "voice.inbound",
  "url": "https://yoururl.com",
  "signingKey": "mysecretkey",
  "eventFilters": [
    {
      "key": "channelId",
      "value": "b827924e-9789-4c2f-a4d5-b352175354f6"
    },
    {
      "key": "status",
      "value": "completed"
    },
    {
      "key": "status",
      "value": "starting"
    }
  ]
}

For voice events (voice.inbound and voice.outbound), there are various filtering options available, such as channel ID and call status.

Last updated