Update a webhook subscription
curl --request PATCH \
--url https://api.protodesk.io/v1/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/protodesk/webhooks",
"events": [],
"metadata": {
"source": "owner_app"
}
}
'import requests
url = "https://api.protodesk.io/v1/webhooks/{webhookId}"
payload = {
"url": "https://example.com/protodesk/webhooks",
"events": [],
"metadata": { "source": "owner_app" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/protodesk/webhooks',
events: [],
metadata: {source: 'owner_app'}
})
};
fetch('https://api.protodesk.io/v1/webhooks/{webhookId}', 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.protodesk.io/v1/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/protodesk/webhooks',
'events' => [
],
'metadata' => [
'source' => 'owner_app'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.protodesk.io/v1/webhooks/{webhookId}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/protodesk/webhooks\",\n \"events\": [],\n \"metadata\": {\n \"source\": \"owner_app\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.protodesk.io/v1/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/protodesk/webhooks\",\n \"events\": [],\n \"metadata\": {\n \"source\": \"owner_app\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/webhooks/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/protodesk/webhooks\",\n \"events\": [],\n \"metadata\": {\n \"source\": \"owner_app\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "wh_x6q5vl75f5d53m7oet2k4r5w6a",
"url": "https://example.com/protodesk/webhooks",
"events": [
"customer.created"
],
"status": "active",
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secret": "whsec_pz6kyr2ftwsn6c6q3a4oky2d35txmgaj3t35u2quy4ielzqro3za"
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
}
}Webhooks
Update a webhook subscription
PATCH
/
webhooks
/
{webhookId}
Update a webhook subscription
curl --request PATCH \
--url https://api.protodesk.io/v1/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/protodesk/webhooks",
"events": [],
"metadata": {
"source": "owner_app"
}
}
'import requests
url = "https://api.protodesk.io/v1/webhooks/{webhookId}"
payload = {
"url": "https://example.com/protodesk/webhooks",
"events": [],
"metadata": { "source": "owner_app" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/protodesk/webhooks',
events: [],
metadata: {source: 'owner_app'}
})
};
fetch('https://api.protodesk.io/v1/webhooks/{webhookId}', 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.protodesk.io/v1/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/protodesk/webhooks',
'events' => [
],
'metadata' => [
'source' => 'owner_app'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.protodesk.io/v1/webhooks/{webhookId}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/protodesk/webhooks\",\n \"events\": [],\n \"metadata\": {\n \"source\": \"owner_app\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.protodesk.io/v1/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/protodesk/webhooks\",\n \"events\": [],\n \"metadata\": {\n \"source\": \"owner_app\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/webhooks/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/protodesk/webhooks\",\n \"events\": [],\n \"metadata\": {\n \"source\": \"owner_app\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "wh_x6q5vl75f5d53m7oet2k4r5w6a",
"url": "https://example.com/protodesk/webhooks",
"events": [
"customer.created"
],
"status": "active",
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secret": "whsec_pz6kyr2ftwsn6c6q3a4oky2d35txmgaj3t35u2quy4ielzqro3za"
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
}
}Authorizations
Use a workspace API key in the Authorization header. Keys use pk_live_<key_id> for production and pk_test<key_id>_ for test mode.
Path Parameters
Example:
"wh_x6q5vl75f5d53m7oet2k4r5w6a"
Body
application/json
HTTPS endpoint that will receive signed webhook deliveries.
Example:
"https://example.com/protodesk/webhooks"
Minimum array length:
1Available options:
customer.created, customer.updated, conversation.created, conversation.updated, conversation.assigned, conversation.resolved, conversation.read, message.created, message.delivered, message.failed Available options:
active, disabled Replaces the full webhook metadata object.
Example:
{ "source": "owner_app" }
Response
Updated webhook subscription.
Example:
"wh_x6q5vl75f5d53m7oet2k4r5w6a"
Example:
"https://example.com/protodesk/webhooks"
Available options:
customer.created, customer.updated, conversation.created, conversation.updated, conversation.assigned, conversation.resolved, conversation.read, message.created, message.delivered, message.failed Available options:
active, disabled Signing secret; returned only when the webhook is created, null on reads.
Example:
"whsec_pz6kyr2ftwsn6c6q3a4oky2d35txmgaj3t35u2quy4ielzqro3za"
