Skip to content

Webhooks

Webhooks push events from Comcent to your server as they happen, so your application can attach each call to the customer’s record without polling.

Event typeSetting in ComcentSent when
NEW_CALL_STORYCall update eventA call has ended and its call story is ready, with recordings, and with the transcript, sentiment and summary when AI Insights are on. Sent once per call.
PRESENCE_UPDATEPresence update eventA member’s presence changes, e.g. from Available to On Break, or to On Call when a call starts.

There are no other events today. In particular there is no event while a call is ringing or in progress; your browser page sees those directly through SIP.js (see Browser calling).

  1. As an admin, open Settings → Webhooks and add a webhook.
  2. Enter a Name (at least 3 characters) and the URL of your endpoint. Use https://: the token travels in a header.
  3. Tick at least one event and save.
  4. Copy the webhook’s Auth token from the list (click Show or Copy). Comcent sends it with every delivery.

You can create several webhooks, e.g. one per environment. Each receives only the events ticked for it.

Every delivery is an HTTP POST with a JSON body:

POST /comcent/webhook HTTP/1.1
Content-Type: application/json
X-Api-Token: <the webhook's auth token>
{
"type": "NEW_CALL_STORY",
"data": { … }
}
  • Field names in webhook bodies are snake_case.
  • Respond within 10 seconds with any 2xx status, and do slow work (downloading recordings, updating your records) in the background. Redirects are not followed and count as failures.
  • No retries. A delivery is attempted once. If your endpoint is down or returns an error, that event is lost. The call is still in the Comcent web app’s call history.
  • Automatic turn-off. After 10 failed deliveries in a row, Comcent turns the webhook off and emails your organisation’s admins. Events raised while it is off are not delivered later. Fix the endpoint, then click Turn back on in Settings → Webhooks (or save the webhook again). A successful delivery resets the failure count.
  • No ordering or de-duplication ids. Use data.uuid (calls) to recognise a call you have already stored.

Comcent authenticates deliveries with a shared secret, not a signature: each request carries the webhook’s auth token in the X-Api-Token header.

// Express example
app.post("/comcent/webhook", express.json({ limit: "5mb" }), (req, res) => {
const token = req.get("X-Api-Token") || "";
const expected = process.env.COMCENT_WEBHOOK_TOKEN;
const ok = token.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(token), Buffer.from(expected));
if (!ok) return res.sendStatus(401);
res.sendStatus(204); // acknowledge first
queue.push(req.body); // then process in the background
});

data is the call as a vCon document, version 0.4.0, an open JSON format for conversations.

An inbound call to +14155550100, answered by the agent Maya, with AI Insights on:

{
"type": "NEW_CALL_STORY",
"data": {
"vcon": "0.4.0",
"uuid": "7f3c2a10-5b1e-4c8a-9d2f-1a2b3c4d5e6f",
"created_at": "2026-10-05T09:51:00Z",
"parties": [
{ "tel": "+16505550188" },
{ "tel": "+14155550100" },
{ "tel": "maya@acme.sip.comcent.io", "mailto": "maya@acme.example", "name": "Maya Chen" }
],
"dialog": [
{
"type": "recording",
"start": "2026-10-05T09:51:08Z",
"duration": 172,
"parties": [0, 1],
"mediatype": "audio/x-wav",
"filename": "c1a1d6e2-…-both.wav",
"url": "https://…/acme/recording/c1a1d6e2-…-both.wav?X-Amz-Expires=604800&X-Amz-Signature=…",
"content_hash": "sha512-3q2-7wAAAAA…"
}
],
"attachments": [
{
"purpose": "comcent.call_story",
"party": 0,
"dialog": 0,
"start": "2026-10-05T09:51:00Z",
"encoding": "json",
"body": {
"id": "7f3c2a10-5b1e-4c8a-9d2f-1a2b3c4d5e6f",
"org_id": "org_…",
"start_at": "2026-10-05T09:51:00Z",
"end_at": "2026-10-05T09:54:00Z",
"caller": "+16505550188",
"callee": "+14155550100",
"outbound_caller_id": null,
"direction": "inbound",
"hangup_party": "+16505550188",
"is_transcribed": true,
"is_summarized": true,
"is_sentiment_analyzed": true,
"is_anonymized": false,
"legs": [
{
"channel_id": "c1a1d6e2-…",
"party": "+16505550188",
"call_spans": [
{ "id": "…", "type": "DIAL_WAIT", "channel_id": "c1a1d6e2-…", "start_at": "2026-10-05T09:51:00Z", "end_at": "2026-10-05T09:51:01Z", "current_party": "+16505550188", "metadata": null, "call_story_id": "7f3c2a10-…" },
{ "id": "…", "type": "QUEUED", "channel_id": "c1a1d6e2-…", "start_at": "2026-10-05T09:51:02Z", "end_at": "2026-10-05T09:51:07Z", "current_party": "+16505550188", "metadata": null, "call_story_id": "7f3c2a10-…" },
{ "id": "…", "type": "ON_CALL", "channel_id": "c1a1d6e2-…", "start_at": "2026-10-05T09:51:01Z", "end_at": "2026-10-05T09:54:00Z", "current_party": "+16505550188", "metadata": null, "call_story_id": "7f3c2a10-…" },
{ "id": "…", "type": "RECORDING", "channel_id": "c1a1d6e2-…", "start_at": "2026-10-05T09:51:08Z", "end_at": "2026-10-05T09:54:00Z", "current_party": "+16505550188",
"metadata": { "file_name": "c1a1d6e2-…-both.wav", "direction": "both", "sha512": "dead…beef", "fileSize": "2752044" }, "call_story_id": "7f3c2a10-…" },
{ "id": "…", "type": "RECORDING", "channel_id": "c1a1d6e2-…", "start_at": "2026-10-05T09:51:08Z", "end_at": "2026-10-05T09:54:00Z", "current_party": "+16505550188",
"metadata": { "file_name": "c1a1d6e2-…-in.wav", "direction": "in", "sha512": "…", "fileSize": "1376044", "sentiment": "neutral" }, "call_story_id": "7f3c2a10-…" }
]
},
{
"channel_id": "a9b8f0c3-…",
"party": "maya@acme.sip.comcent.io",
"call_spans": [
{ "id": "…", "type": "RINGING", "channel_id": "a9b8f0c3-…", "start_at": "2026-10-05T09:51:03Z", "end_at": "2026-10-05T09:51:07Z", "current_party": "maya@acme.sip.comcent.io", "metadata": null, "call_story_id": "7f3c2a10-…" },
{ "id": "…", "type": "ON_CALL", "channel_id": "a9b8f0c3-…", "start_at": "2026-10-05T09:51:07Z", "end_at": "2026-10-05T09:54:00Z", "current_party": "maya@acme.sip.comcent.io", "metadata": null, "call_story_id": "7f3c2a10-…" },
{ "id": "…", "type": "RECORDING", "channel_id": "a9b8f0c3-…", "start_at": "2026-10-05T09:51:08Z", "end_at": "2026-10-05T09:54:00Z", "current_party": "maya@acme.sip.comcent.io",
"metadata": { "file_name": "a9b8f0c3-…-in.wav", "direction": "in", "sha512": "…", "fileSize": "1375900", "sentiment": "positive" }, "call_story_id": "7f3c2a10-…" }
]
}
]
}
}
],
"analysis": [
{
"type": "sentiment", "vendor": "comcent", "schema": "comcent.deepgram.nova2.v1", "encoding": "json",
"body": [
{ "current_party": "+16505550188", "sentiment": "neutral", "sentiment_score": 0.05 },
{ "current_party": "maya@acme.sip.comcent.io", "sentiment": "positive", "sentiment_score": 0.62 }
]
},
{
"type": "transcript", "vendor": "comcent", "schema": "comcent.deepgram.nova2.v1", "encoding": "json",
"body": [
{ "current_party": "maya@acme.sip.comcent.io", "start": 1791107469, "message": "Thanks for calling Acme, this is Maya." },
{ "current_party": "+16505550188", "start": 1791107473, "message": "Hi, I'd like a refund on my last booking." }
]
},
{
"type": "summary", "vendor": "comcent", "schema": "comcent.deepgram.nova2.v1", "encoding": "none",
"body": "The customer asked for a refund; the agent agreed to process it."
}
]
}
}

With AI Insights off, the webhook is sent as soon as the call is saved: analysis is [], the is_* flags are false, and recording metadata has no sentiment.

FieldTypeDescription
vconstringAlways "0.4.0".
uuidstringThe call story id. The same id as in the call’s page in the Comcent web app (/app/<subdomain>/call-story/<id>).
created_atstringWhen the call started (ISO 8601, UTC).
partiesarrayEveryone on the call.
dialogarrayThe call’s recordings and transfers.
attachmentsarrayOne attachment with Comcent’s full call record.
analysisarraySentiment, transcript and summary, when AI Insights ran.
FieldTypeDescription
telstringA phone number in E.164, or a member’s SIP address (username@<subdomain>.sip.comcent.io on Comcent Cloud).
mailtostringOnly for members: the member’s email.
namestringOnly for members: the member’s name.

Order: the caller, the callee (for an inbound call, the number that was dialled), then everyone else who joined, such as the agent who answered. dialog entries refer to parties by their index in this list. To find the agent, take the parties that have a mailto.

typeFieldsWhen
recordingstart, duration (seconds), parties (indexes), mediatype (audio/x-wav), filename, url, content_hash; and originator (a party index) on transferred callsOne per recorded conversation. A call that was transferred has one recording per agent.
transferstart, transferor, transferee, transfer_target (party indexes), original, target_dialog (dialog indexes)Between consecutive recordings of a transferred call.
incompletestart, duration, parties, dispositionA call that was never answered. disposition is no-answer, busy, congestion or hung-up, or null when the reason is unknown. A caller who waited in a queue that no agent answered gets a recording instead, because the caller’s own call was answered.
  • url is a pre-signed download link that expires after 7 days. Download the recording when you receive the webhook if you need to keep it. It stays available in the Comcent web app’s call history.
  • content_hash is sha512- followed by the URL-safe base64 SHA-512 of the file. url and content_hash can be null if the recording could not be stored.
  • For every leg of the call, including agents who rang but did not answer, see attachments[0].body.legs.

purpose is "comcent.call_story", encoding is "json" and body is an object:

FieldTypeDescription
idstringCall story id (same as uuid).
org_idstringYour organisation’s id.
start_at, end_atstringStart and end of the call.
caller, calleestringE.164 number or member SIP address.
outbound_caller_idstring or nullCaller ID used on an outbound call.
directionstringinbound or outbound.
hangup_partystring or nullWho hung up first.
is_transcribed, is_summarized, is_sentiment_analyzed, is_anonymizedbooleanProcessing state.
legsarrayOne entry per call leg (the customer, each agent who rang): channel_id, party (whose leg) and call_spans, sorted by time. Legs are not in a guaranteed order.

Each call_spans[] entry:

FieldTypeDescription
idstringSpan id.
typestringDIAL_WAIT (call set-up), RINGING (an agent’s phone rang), QUEUED (waiting in a queue), ON_CALL, HOLD, RECORDING.
channel_idstringThe leg this span belongs to.
start_at, end_atstringStart and end; end_at may be null.
current_partystringWhose leg it is.
call_story_idstringThe call story id.
metadataobject or nullRECORDING: file_name, direction (both = the whole conversation, in = this party’s audio), sha512 (hex), fileSize (bytes, as a string), and sentiment on in recordings when AI Insights ran. A RINGING span that ended without an answer: answer_state, hangup_cause. Otherwise null.

Present only when AI Insights processed the call. Every entry has vendor: "comcent" and schema: "comcent.deepgram.nova2.v1".

typeencodingbody
sentimentjson[{ current_party, sentiment, sentiment_score }], one per party. sentiment is positive, neutral or negative.
transcriptjson[{ current_party, start, message }], one per turn. start is a Unix timestamp in seconds.
summarynoneThe summary as plain text.
{
"type": "PRESENCE_UPDATE",
"data": {
"subdomain": "acme",
"user_id": "c0ffee…",
"username": "maya",
"email": "maya@acme.example",
"name": "Maya Chen",
"presence": "On Break",
"previous_presence": "Available",
"changed_at": "2026-10-19T10:15:42Z"
}
}

presence and previous_presence are Available, On Break, Logged Out, On Call or Wrap Up. It is sent for changes the agent makes and for changes Comcent makes (a call starting or ending, the agent’s browser going offline). Nothing is sent when the presence does not actually change.