Update a webhook subscription
curl --request PATCH \
--url https://api.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"status": "disabled"
}
'import requests
url = "https://api.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id}"
payload = { "status": "disabled" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'disabled'})
};
fetch('https://api.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_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.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_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([
'status' => 'disabled'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id}"
payload := strings.NewReader("{\n \"status\": \"disabled\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"disabled\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"disabled\"\n}"
response = http.request(request)
puts response.read_bodyWebhook Subscriptions
Update a webhook subscription
Scope api_keys:write. agent_id cannot be changed — sending it is a 400. A headers update replaces the whole object, because values are never readable and so cannot be merged client-side.
PATCH
/
webhooks
/
subscriptions
/
{subscription_id}
Update a webhook subscription
curl --request PATCH \
--url https://api.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"status": "disabled"
}
'import requests
url = "https://api.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id}"
payload = { "status": "disabled" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'disabled'})
};
fetch('https://api.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_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.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_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([
'status' => 'disabled'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id}"
payload := strings.NewReader("{\n \"status\": \"disabled\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"disabled\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lehar.ai/ca/api/v0/webhooks/subscriptions/{subscription_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"disabled\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
ApiKeyAuthBearerAuth
Path Parameters
Body
application/json
Available options:
call_started, call_completed, recording_completed Available options:
active, disabled Replaces every header on this subscription.
Show child attributes
Show child attributes
Turning it on mints a secret and returns it once. Turning it on when already on is a no-op, not a rotation. Turning it off clears the secret.
Mint a fresh secret and return it once.
Delivery wire shape. native (the default) is the documented contract; a custom format's exact value is provided during integration.
Response
Updated subscription. Carries signing_secret only when this request minted one.

