Skip to main content
POST
/
webhooks
Create Webhook
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": [
    "<string>"
  ],
  "name": "<string>",
  "signing_method": "hmac_sha256",
  "secret": "<string>",
  "scope_type": "global",
  "persona_id": "<string>",
  "timeout_ms": 5000,
  "max_retries": 3
}
'
{
  "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>"
}

Authorizations

X-API-Key
string
header
required

Workspace API key (e.g. kej_live_...)

Body

application/json

Create a webhook subscription (public API).

url
string<uri>
required

URL to send webhook events to

Required string length: 1 - 2083
events
string[]
required

List of event types to subscribe to. Use '*' for all events.

Examples:
["call.ended", "contact.updated"]
["*"]
name
string | null

Display name for the webhook

signing_method
enum<string>
default:hmac_sha256

Signing method: hmac_sha256, hmac_sha1, bearer, basic_auth, none

Available options:
hmac_sha256,
hmac_sha1,
bearer,
basic_auth,
none
secret
string | null

Signing secret (auto-creates workspace secret)

scope_type
enum<string>
default:global

Scope filtering: 'global' for all events, 'persona' for specific persona

Available options:
global,
persona
persona_id
string | null

Persona ID if scope_type is 'persona'

timeout_ms
integer
default:5000

Request timeout in milliseconds (1000-30000)

Required range: 1000 <= x <= 30000
max_retries
integer
default:3

Maximum retry attempts (0-10)

Required range: 0 <= x <= 10

Response

Successful Response

Webhook subscription response (public-safe).

id
string
required
url
string
required
events
string[]
required
signing_method
enum<string>
required

Webhook signing methods.

Available options:
hmac_sha256,
hmac_sha1,
bearer,
basic_auth,
none
scope_type
enum<string>
required

Webhook scope types.

Available options:
global,
persona
delivery_settings
WebhookDeliverySettings · object
required

Delivery configuration for a webhook subscription.

stats
WebhookStats · object
required

Delivery statistics for a webhook subscription.

name
string | null
persona_id
string | null
last_delivery_at
string | null
last_error
string | null
created_at
string | null
updated_at
string | null