curl --request POST \
--url https://api.kejue.co/api/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"url": "<string>",
"events": [
"call.ended",
"contact.updated"
],
"name": "<string>",
"signing_method": "hmac_sha256",
"secret": "<string>",
"scope_type": "global",
"persona_id": "<string>",
"timeout_ms": 5000,
"max_retries": 3
}
'import requests
url = "https://api.kejue.co/api/v1/webhooks"
payload = {
"url": "<string>",
"events": ["call.ended", "contact.updated"],
"name": "<string>",
"signing_method": "hmac_sha256",
"secret": "<string>",
"scope_type": "global",
"persona_id": "<string>",
"timeout_ms": 5000,
"max_retries": 3
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
events: ['call.ended', 'contact.updated'],
name: '<string>',
signing_method: 'hmac_sha256',
secret: '<string>',
scope_type: 'global',
persona_id: '<string>',
timeout_ms: 5000,
max_retries: 3
})
};
fetch('https://api.kejue.co/api/v1/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://api.kejue.co/api/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'events' => [
'call.ended',
'contact.updated'
],
'name' => '<string>',
'signing_method' => 'hmac_sha256',
'secret' => '<string>',
'scope_type' => 'global',
'persona_id' => '<string>',
'timeout_ms' => 5000,
'max_retries' => 3
]),
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"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"call.ended\",\n \"contact.updated\"\n ],\n \"name\": \"<string>\",\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\",\n \"scope_type\": \"global\",\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 5000,\n \"max_retries\": 3\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.kejue.co/api/v1/webhooks")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n \"call.ended\",\n \"contact.updated\"\n ],\n \"name\": \"<string>\",\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\",\n \"scope_type\": \"global\",\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 5000,\n \"max_retries\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kejue.co/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n \"call.ended\",\n \"contact.updated\"\n ],\n \"name\": \"<string>\",\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\",\n \"scope_type\": \"global\",\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 5000,\n \"max_retries\": 3\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"signing_method": "hmac_sha256",
"scope_type": "global",
"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": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"errors": [
{
"field": "body.name",
"message": "Field required",
"type": "missing"
}
]
}
}Create Webhook
Create a webhook subscription.
Events will be POSTed to the URL with HMAC-SHA256 signature verification.
curl --request POST \
--url https://api.kejue.co/api/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"url": "<string>",
"events": [
"call.ended",
"contact.updated"
],
"name": "<string>",
"signing_method": "hmac_sha256",
"secret": "<string>",
"scope_type": "global",
"persona_id": "<string>",
"timeout_ms": 5000,
"max_retries": 3
}
'import requests
url = "https://api.kejue.co/api/v1/webhooks"
payload = {
"url": "<string>",
"events": ["call.ended", "contact.updated"],
"name": "<string>",
"signing_method": "hmac_sha256",
"secret": "<string>",
"scope_type": "global",
"persona_id": "<string>",
"timeout_ms": 5000,
"max_retries": 3
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
events: ['call.ended', 'contact.updated'],
name: '<string>',
signing_method: 'hmac_sha256',
secret: '<string>',
scope_type: 'global',
persona_id: '<string>',
timeout_ms: 5000,
max_retries: 3
})
};
fetch('https://api.kejue.co/api/v1/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://api.kejue.co/api/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'events' => [
'call.ended',
'contact.updated'
],
'name' => '<string>',
'signing_method' => 'hmac_sha256',
'secret' => '<string>',
'scope_type' => 'global',
'persona_id' => '<string>',
'timeout_ms' => 5000,
'max_retries' => 3
]),
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"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"call.ended\",\n \"contact.updated\"\n ],\n \"name\": \"<string>\",\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\",\n \"scope_type\": \"global\",\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 5000,\n \"max_retries\": 3\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.kejue.co/api/v1/webhooks")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n \"call.ended\",\n \"contact.updated\"\n ],\n \"name\": \"<string>\",\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\",\n \"scope_type\": \"global\",\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 5000,\n \"max_retries\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kejue.co/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n \"call.ended\",\n \"contact.updated\"\n ],\n \"name\": \"<string>\",\n \"signing_method\": \"hmac_sha256\",\n \"secret\": \"<string>\",\n \"scope_type\": \"global\",\n \"persona_id\": \"<string>\",\n \"timeout_ms\": 5000,\n \"max_retries\": 3\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"signing_method": "hmac_sha256",
"scope_type": "global",
"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": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"errors": [
{
"field": "body.name",
"message": "Field required",
"type": "missing"
}
]
}
}Authorizations
Workspace API key (e.g. kej_live_...)
Body
Create a webhook subscription (public API).
URL to send webhook events to
1 - 2083List of event types to subscribe to. Use '*' for all events.
["call.ended", "contact.updated"]
["*"]
Display name for the webhook
Signing method: hmac_sha256, hmac_sha1, bearer, basic_auth, none
hmac_sha256, hmac_sha1, bearer, basic_auth, none Signing secret (auto-creates workspace secret)
Scope filtering: 'global' for all events, 'persona' for specific persona
global, persona Persona ID if scope_type is 'persona'
Request timeout in milliseconds (1000-30000)
1000 <= x <= 30000Maximum retry attempts (0-10)
0 <= x <= 10Response
Successful Response
Webhook subscription response (public-safe).
Webhook signing methods.
hmac_sha256, hmac_sha1, bearer, basic_auth, none Webhook scope types.
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

