Skip to Content

Webhooks

Get a signed POST to your endpoint when a call finishes, DNCR prevents dialing, or a campaign changes state.

When a call completes, a confirmed DNCR match prevents dialing, or a campaign changes state, we POST a signed JSON body to your HTTPS endpoint, retry if it fails, and keep every delivery so you can inspect or replay it.

curl -X POST https://api.kejue.co/v1/webhooks \
  -H "Authorization: Bearer $KEJUE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 018f4d7a-create-crm-webhook" \
  --data '{
    "name": "CRM sync",
    "url": "https://example.com/hooks/kejue",
    "events": ["call.completed", "campaign.completed"]
  }'

Over the API: POST /v1/webhooks.

The response contains your whsec_... signing secret, and it's shown once. Store it now — you'll need it to verify every delivery.

Events

Subscribe to one or more of these seven events:

EventFires when
call.completedA call on a subscribed agent finishes
call.dncr_blockedA confirmed DNCR match prevents dialing
campaign.startedCalling begins
campaign.pausedCall feeding stopped — by you or by us
campaign.resumedA paused campaign picks back up
campaign.completedEvery recipient is done, or the end time passed
campaign.stoppedEnded permanently

Campaign events and call.dncr_blocked go to every active webhook in the workspace that subscribes to that event. DNCR refusals need no agent attachment. call.completed is per agent: attach the webhook in the agent's after-call settings and promote the draft.

What arrives

Canonical JSON, up to 2 MB. Every envelope key is always present — nullables come through as explicit null, and arrays stay arrays when empty, so your parser doesn't need to handle missing keys.

KeyMeaning
api_version2026-07-01
eventThe event name
delivery_idUnique per delivery — your deduplication key
delivered_atWhen this attempt's payload was assembled
testtrue for test deliveries
replayed_from_idThe original delivery's ID, on replays
call / campaignThe payload. Both keys always appear; the one that doesn't apply is null

Field-by-field payloads and examples: Webhook payloads.

We deliberately don't include outbound call variables, raw SIP headers, or tool request and response bodies — they can carry credentials and context you didn't intend to publish. To get business data out of a call, put it in an extraction object.

We exclude runtime context, outbound variables, raw SIP headers and participant attributes, credentials, and tool request/response bodies. Test deliveries use the same eight envelope keys with test: true and a null event payload.

Managing webhooks

URLs must be public HTTPS. Credentials in the URL, fragments, and private or internal addresses are rejected.

OperationWhat it does
POST /v1/webhooksCreate. Returns the signing secret, once
GET /v1/webhooksList, filtered by name, active state, or event
GET /v1/webhooks/{id}Metadata. Never the secret
PATCH /v1/webhooks/{id}Change the name, URL, events, or active state
POST /v1/webhooks/{id}/rotate-secretNew secret; the old one stops signing
DELETE /v1/webhooks/{id}Archive. Refused while an active agent references it

Testing

Send yourself a test delivery before a real call depends on it.

Over the API: POST /v1/webhooks/{id}/test.

That's a real signed delivery to your real endpoint with a null payload, so you can check your signature verification before a real call depends on it.

Looking at deliveries

  • GET /v1/webhook-deliveries — every attempt, filterable by webhook, call, event, status, or whether it was a test.
  • GET /v1/webhook-deliveries/{id} — one delivery, including a sanitized preview of what your endpoint responded with. This is where you find out that your endpoint returned a 500 with an HTML error page.
  • POST /v1/webhook-deliveries/{id}/replay — send it again. By default this resends the stored payload; mode: rebuild reassembles it from the call's current results, which is what you want after fixing an extraction.

A replay is a new delivery with its own ID, and it tells your endpoint which delivery it came from.

See also

Verifying deliveries · Webhook payloads · Calls

On this page