Update Webhook
curl --request PATCH \
--url https://api.example.com/v1/webhooks/{id} \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
{}
],
"active": true,
"description": "<string>"
}
'import requests
url = "https://api.example.com/v1/webhooks/{id}"
payload = {
"url": "<string>",
"events": [{}],
"active": True,
"description": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [{}], active: true, description: '<string>'})
};
fetch('https://api.example.com/v1/webhooks/{id}', 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.example.com/v1/webhooks/{id}",
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' => '<string>',
'events' => [
[
]
],
'active' => true,
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"active\": true,\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.example.com/v1/webhooks/{id}")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"active\": true,\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"active\": true,\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"webhook": {
"id": "<string>",
"url": "<string>",
"events": [
{}
],
"description": "<string>",
"active": true,
"updated_at": "<string>"
}
}
}Webhooks
Update Webhook
Modify an existing webhook’s URL, events, or active state
PATCH
/
v1
/
webhooks
/
{id}
Update Webhook
curl --request PATCH \
--url https://api.example.com/v1/webhooks/{id} \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
{}
],
"active": true,
"description": "<string>"
}
'import requests
url = "https://api.example.com/v1/webhooks/{id}"
payload = {
"url": "<string>",
"events": [{}],
"active": True,
"description": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [{}], active: true, description: '<string>'})
};
fetch('https://api.example.com/v1/webhooks/{id}', 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.example.com/v1/webhooks/{id}",
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' => '<string>',
'events' => [
[
]
],
'active' => true,
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"active\": true,\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.example.com/v1/webhooks/{id}")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"active\": true,\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"active\": true,\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"webhook": {
"id": "<string>",
"url": "<string>",
"events": [
{}
],
"description": "<string>",
"active": true,
"updated_at": "<string>"
}
}
}Request
Path Parameters
string
required
The webhook’s unique ID (UUID)
Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Requires an API key with the
webhooks:write permission. All body fields are optional — only include the fields you want to change.Body Parameters
string
New HTTPS target URL. Must start with
https:// and not resolve to a private IP.array
Replacement array of event type strings. This replaces the full list — it is not merged. To remove an event, send the array without it.
boolean
Pause (
false) or resume (true) deliveries without changing configuration.string
Update the human-readable description.
Response
object
The signing secret does not change on update. To rotate the secret, delete and recreate the webhook.
curl -X PATCH https://data.leadlex.com/functions/v1/api-gateway/v1/webhooks/7f3c4d2a-1b8e-4a9c-9d6f-2e5b8c7a1f3d \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"events": ["contact.created", "contact.updated", "deal.updated"],
"active": true
}'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
WEBHOOK_ID = "7f3c4d2a-1b8e-4a9c-9d6f-2e5b8c7a1f3d"
response = requests.patch(
f"{BASE_URL}/v1/webhooks/{WEBHOOK_ID}",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={
"events": ["contact.created", "contact.updated", "deal.updated"],
"active": True,
},
)
webhook = response.json()["data"]["webhook"]
const WEBHOOK_ID = '7f3c4d2a-1b8e-4a9c-9d6f-2e5b8c7a1f3d';
const response = await fetch(
`https://data.leadlex.com/functions/v1/api-gateway/v1/webhooks/${WEBHOOK_ID}`,
{
method: 'PATCH',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
events: ['contact.created', 'contact.updated', 'deal.updated'],
active: true,
}),
}
);
const { data } = await response.json();
Example Response
{
"data": {
"webhook": {
"id": "7f3c4d2a-1b8e-4a9c-9d6f-2e5b8c7a1f3d",
"url": "https://example.com/leadlex/webhook",
"events": ["contact.created", "contact.updated", "deal.updated"],
"description": "Production CRM sync",
"active": true,
"updated_at": "2026-04-17T14:30:00Z"
}
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_url | URL is not HTTPS, malformed, or resolves to a private IP |
| 400 | invalid_events | One or more event names are not recognized |
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing webhooks:write permission |
| 404 | webhook_not_found | No webhook with this ID in your workspace |
| 429 | rate_limited | Rate limit exceeded |