Update Subscription Events
curl --request PUT \
--url https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"add": [],
"remove": []
}
'import requests
url = "https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events"
payload = {
"add": [],
"remove": []
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({add: [], remove: []})
};
fetch('https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'add' => [
],
'remove' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events"
payload := strings.NewReader("{\n \"add\": [],\n \"remove\": []\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"add\": [],\n \"remove\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"add\": [],\n \"remove\": []\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"clientId": "<string>",
"agentId": "<string>",
"webhookUrl": "<string>",
"events": [
"call.started"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Webhook Subscriptions
Update Subscription Events
Update events for a specific webhook subscription
PUT
/
webhooks
/
subscriptions
/
{subscriptionId}
/
events
Update Subscription Events
curl --request PUT \
--url https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"add": [],
"remove": []
}
'import requests
url = "https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events"
payload = {
"add": [],
"remove": []
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({add: [], remove: []})
};
fetch('https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'add' => [
],
'remove' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events"
payload := strings.NewReader("{\n \"add\": [],\n \"remove\": []\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"add\": [],\n \"remove\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chat-dash.com/v1/public/webhooks/subscriptions/{subscriptionId}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"add\": [],\n \"remove\": []\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"clientId": "<string>",
"agentId": "<string>",
"webhookUrl": "<string>",
"events": [
"call.started"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Headers
Client-specific API key for authentication
Pattern:
^CD\.CL\.Path Parameters
Webhook subscription ID
Body
application/json
Response
200 - application/json
Events updated successfully
Unique identifier for the subscription
The client associated with the subscription
The agent associated with the subscription
The URL where event notifications will be sent
List of events that trigger notifications
Available options:
call.started, call.missed, call.ended, call.inbound When the subscription was created
When the subscription was last updated
