Update webhook
curl --request PUT \
--url https://developer.encrata.com/api/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"description": "<string>",
"is_active": true,
"chat_id": "<string>"
}
'import requests
url = "https://developer.encrata.com/api/webhooks"
payload = {
"id": "<string>",
"url": "<string>",
"events": ["<string>"],
"description": "<string>",
"is_active": True,
"chat_id": "<string>"
}
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,
chat_id: '<string>'
})
};
fetch('https://developer.encrata.com/api/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://developer.encrata.com/api/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,
'chat_id' => '<string>'
]),
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://developer.encrata.com/api/webhooks"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"is_active\": true,\n \"chat_id\": \"<string>\"\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://developer.encrata.com/api/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 \"chat_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/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 \"chat_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"status": "<string>"
},
"message": "<string>"
}Webhooks
Update webhook
Change a webhook’s URL, events, description, or active status.
PUT
/
api
/
webhooks
Update webhook
curl --request PUT \
--url https://developer.encrata.com/api/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"description": "<string>",
"is_active": true,
"chat_id": "<string>"
}
'import requests
url = "https://developer.encrata.com/api/webhooks"
payload = {
"id": "<string>",
"url": "<string>",
"events": ["<string>"],
"description": "<string>",
"is_active": True,
"chat_id": "<string>"
}
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,
chat_id: '<string>'
})
};
fetch('https://developer.encrata.com/api/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://developer.encrata.com/api/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,
'chat_id' => '<string>'
]),
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://developer.encrata.com/api/webhooks"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"is_active\": true,\n \"chat_id\": \"<string>\"\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://developer.encrata.com/api/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 \"chat_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/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 \"chat_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"status": "<string>"
},
"message": "<string>"
}Applies a partial update. Send only the fields you want to change: anything you leave out keeps its stored value.
Authentication
Send your API key as a bearer token.Authorization: Bearer enc_xxxxxxxxxxxx
Updating a webhook requires the workspace
admin role. tech and readonly keys get 403.Request
string
required
The webhook ID to update. This is the only required field.
string
A new HTTPS URL. Must resolve to a public address. Ignored for
telegram webhooks, whose target comes from the bot token.string[]
Replaces the subscribed events. Must be non-empty, known, and free of duplicates. See supported events.
string
A new label. Trimmed, and limited to 255 characters. Send
"" to clear it.boolean
Set to
false to pause deliveries without deleting the webhook. Set to true to resume.string
Re-points a
telegram webhook at a different chat. Ignored for other kinds.The destination
kind is immutable. To move from a generic endpoint to Slack, delete the webhook and create a new one.Examples
curl -X PUT https://developer.encrata.com/api/webhooks \
-H "Authorization: Bearer enc_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"id": "360cb300-d885-4c18-af2c-d259f936bb38",
"is_active": false
}'
curl -X PUT https://developer.encrata.com/api/webhooks \
-H "Authorization: Bearer enc_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"id": "360cb300-d885-4c18-af2c-d259f936bb38",
"events": ["lookup.completed", "bulk.completed"]
}'
import requests
requests.put(
"https://developer.encrata.com/api/webhooks",
headers={"Authorization": "Bearer enc_xxxxxxxxxxxx"},
json={
"id": "360cb300-d885-4c18-af2c-d259f936bb38",
"url": "https://example.com/webhooks/encrata-v2",
},
)
await fetch("https://developer.encrata.com/api/webhooks", {
method: "PUT",
headers: {
Authorization: "Bearer enc_xxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
id: "360cb300-d885-4c18-af2c-d259f936bb38",
url: "https://example.com/webhooks/encrata-v2",
}),
});
Response
Returns200 OK. The updated webhook is not echoed back. Call list webhooks or get webhook to read the new state.
boolean
true when the update was applied.string
A human-readable summary.
Example response
{
"success": true,
"result": { "status": "updated" },
"message": "Webhook updated."
}
Errors
| Status | Code | When |
|---|---|---|
400 | bad_request | The JSON body could not be parsed. |
401 | unauthorized | The API key is missing, revoked, or disabled. |
403 | forbidden | Your role is not admin. |
404 | not_found | No webhook with that ID exists in your workspace. |
422 | validation_failed | id was missing, or a supplied field failed validation. |
500 | internal | Encrata could not apply the update. Retry. |
A missing
id returns 422, not 400: the body parsed correctly, but a required value was absent.Example error
{
"success": false,
"result": { "code": "not_found" },
"message": "That webhook no longer exists. It may have been deleted."
}
Next steps
Send a test event
Confirm the new URL is reachable.
Inspect deliveries
See whether deliveries resumed.
Delete a webhook
Remove an endpoint for good.
Supported events
Every event you can subscribe to.
Was this page helpful?