Webhooks
Update Webhook
Update an existing webhook’s URL, events, description, or active status.
PUT
/
api
/
agent
/
webhooks
Update Webhook
curl --request PUT \
--url https://encrata.com/api/agent/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"description": "<string>",
"is_active": true
}
'import requests
url = "https://encrata.com/api/agent/webhooks"
payload = {
"id": "<string>",
"url": "<string>",
"events": ["<string>"],
"description": "<string>",
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
url: '<string>',
events: ['<string>'],
description: '<string>',
is_active: true
})
};
fetch('https://encrata.com/api/agent/webhooks', 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://encrata.com/api/agent/webhooks",
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([
'id' => '<string>',
'url' => '<string>',
'events' => [
'<string>'
],
'description' => '<string>',
'is_active' => true
]),
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://encrata.com/api/agent/webhooks"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"is_active\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://encrata.com/api/agent/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://encrata.com/api/agent/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_bodyAuthentication
Requires an API key in theAuthorization header.
Authorization: Bearer YOUR_API_KEY
Request
string
required
The webhook ID to update.
string
required
The updated HTTPS URL.
string[]
Updated list of subscribed event types.
string
Updated description.
boolean
Set to
false to pause deliveries without deleting the webhook.Example request
curl -X PUT https://encrata.com/api/agent/webhooks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"id": "360cb300-d885-4c18-af2c-d259f936bb38",
"url": "https://example.com/webhook-v2",
"events": ["lookup.completed"],
"description": "Updated webhook",
"is_active": true
}'
Response
Example response
{
"status": "updated"
}
Was this page helpful?
⌘I
Update Webhook
curl --request PUT \
--url https://encrata.com/api/agent/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"description": "<string>",
"is_active": true
}
'import requests
url = "https://encrata.com/api/agent/webhooks"
payload = {
"id": "<string>",
"url": "<string>",
"events": ["<string>"],
"description": "<string>",
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
url: '<string>',
events: ['<string>'],
description: '<string>',
is_active: true
})
};
fetch('https://encrata.com/api/agent/webhooks', 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://encrata.com/api/agent/webhooks",
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([
'id' => '<string>',
'url' => '<string>',
'events' => [
'<string>'
],
'description' => '<string>',
'is_active' => true
]),
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://encrata.com/api/agent/webhooks"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"is_active\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://encrata.com/api/agent/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://encrata.com/api/agent/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body