Update Webhook
curl --request PATCH \
--url https://api.kejue.co/api/v1/webhooks/{webhook_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"persona_id": "<string>",
"timeout_ms": 15500,
"max_retries": 5
}
'import requests
url = "https://api.kejue.co/api/v1/webhooks/{webhook_id}"
payload = {
"name": "<string>",
"url": "<string>",
"events": ["<string>"],
"persona_id": "<string>",
"timeout_ms": 15500,
"max_retries": 5
}
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({
name: '<string>',
url: '<string>',
events: ['<string>'],
persona_id: '<string>',
timeout_ms: 15500,
max_retries: 5
})
};
fetch('https://api.kejue.co/api/v1/webhooks/{webhook_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.kejue.co/api/v1/webhooks/{webhook_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([
'name' => '<string>',
'url' => '<string>',
'events' => [
'<string>'
],
'persona_id' => '<string>',
'timeout_ms' => 15500,
'max_retries' => 5
]),
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.kejue.co/api/v1/webhooks/{webhook_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 15500,\n \"max_retries\": 5\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.kejue.co/api/v1/webhooks/{webhook_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 15500,\n \"max_retries\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kejue.co/api/v1/webhooks/{webhook_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 \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 15500,\n \"max_retries\": 5\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"delivery_settings": {
"timeout_ms": 123,
"max_retries": 123,
"backoff_ms": 123
},
"stats": {
"total_deliveries": 123,
"failed_deliveries": 123,
"success_rate": 123
},
"name": "<string>",
"persona_id": "<string>",
"last_delivery_at": "<string>",
"last_error": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": "Invalid event type: foo.bar",
"code": "BAD_REQUEST",
"details": {}
}{
"error": "Invalid or missing API key",
"code": "UNAUTHORIZED",
"details": {}
}{
"error": "Webhook not found",
"code": "NOT_FOUND",
"details": {
"webhook_id": "non_existent_id"
}
}{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"errors": [
{
"field": "body.name",
"message": "Field required",
"type": "missing"
}
]
}
}Webhooks
Update Webhook
Update a webhook subscription.
PATCH
/
webhooks
/
{webhook_id}
Update Webhook
curl --request PATCH \
--url https://api.kejue.co/api/v1/webhooks/{webhook_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"persona_id": "<string>",
"timeout_ms": 15500,
"max_retries": 5
}
'import requests
url = "https://api.kejue.co/api/v1/webhooks/{webhook_id}"
payload = {
"name": "<string>",
"url": "<string>",
"events": ["<string>"],
"persona_id": "<string>",
"timeout_ms": 15500,
"max_retries": 5
}
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({
name: '<string>',
url: '<string>',
events: ['<string>'],
persona_id: '<string>',
timeout_ms: 15500,
max_retries: 5
})
};
fetch('https://api.kejue.co/api/v1/webhooks/{webhook_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.kejue.co/api/v1/webhooks/{webhook_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([
'name' => '<string>',
'url' => '<string>',
'events' => [
'<string>'
],
'persona_id' => '<string>',
'timeout_ms' => 15500,
'max_retries' => 5
]),
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.kejue.co/api/v1/webhooks/{webhook_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 15500,\n \"max_retries\": 5\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.kejue.co/api/v1/webhooks/{webhook_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 15500,\n \"max_retries\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kejue.co/api/v1/webhooks/{webhook_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 \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 15500,\n \"max_retries\": 5\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"delivery_settings": {
"timeout_ms": 123,
"max_retries": 123,
"backoff_ms": 123
},
"stats": {
"total_deliveries": 123,
"failed_deliveries": 123,
"success_rate": 123
},
"name": "<string>",
"persona_id": "<string>",
"last_delivery_at": "<string>",
"last_error": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": "Invalid event type: foo.bar",
"code": "BAD_REQUEST",
"details": {}
}{
"error": "Invalid or missing API key",
"code": "UNAUTHORIZED",
"details": {}
}{
"error": "Webhook not found",
"code": "NOT_FOUND",
"details": {
"webhook_id": "non_existent_id"
}
}{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"errors": [
{
"field": "body.name",
"message": "Field required",
"type": "missing"
}
]
}
}Authorizations
Workspace API key (e.g. kej_live_...)
Path Parameters
Body
application/json
Partial update for a webhook subscription (public API).
Required string length:
1 - 2083Webhook signing methods.
Available options:
hmac_sha256, hmac_sha1, bearer, basic_auth, none Webhook scope types.
Available options:
global, persona Required range:
1000 <= x <= 30000Required range:
0 <= x <= 10Response
Successful Response
Webhook subscription response (public-safe).
Webhook signing methods.
Available options:
hmac_sha256, hmac_sha1, bearer, basic_auth, none Webhook scope types.
Available options:
global, persona Delivery configuration for a webhook subscription.
Show child attributes
Show child attributes
Delivery statistics for a webhook subscription.
Show child attributes
Show child attributes
⌘I

