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.
Events
Section titled “Events”Event type | Setting in Comcent | Sent when |
|---|---|---|
NEW_CALL_STORY | Call update event | A 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_UPDATE | Presence update event | A 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).
Create a webhook
Section titled “Create a webhook”- As an admin, open Settings → Webhooks and add a webhook.
- Enter a Name (at least 3 characters) and the URL of your endpoint. Use
https://: the token travels in a header. - Tick at least one event and save.
- 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.
Deliveries
Section titled “Deliveries”Every delivery is an HTTP POST with a JSON body:
POST /comcent/webhook HTTP/1.1Content-Type: application/jsonX-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
2xxstatus, 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.
Verify the request
Section titled “Verify the request”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 exampleapp.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});NEW_CALL_STORY
Section titled “NEW_CALL_STORY”data is the call as a vCon document, version 0.4.0, an open JSON format for conversations.
Example
Section titled “Example”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.
Top level
Section titled “Top level”| Field | Type | Description |
|---|---|---|
vcon | string | Always "0.4.0". |
uuid | string | The call story id. The same id as in the call’s page in the Comcent web app (/app/<subdomain>/call-story/<id>). |
created_at | string | When the call started (ISO 8601, UTC). |
parties | array | Everyone on the call. |
dialog | array | The call’s recordings and transfers. |
attachments | array | One attachment with Comcent’s full call record. |
analysis | array | Sentiment, transcript and summary, when AI Insights ran. |
parties[]
Section titled “parties[]”| Field | Type | Description |
|---|---|---|
tel | string | A phone number in E.164, or a member’s SIP address (username@<subdomain>.sip.comcent.io on Comcent Cloud). |
mailto | string | Only for members: the member’s email. |
name | string | Only 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.
dialog[]
Section titled “dialog[]”type | Fields | When |
|---|---|---|
recording | start, duration (seconds), parties (indexes), mediatype (audio/x-wav), filename, url, content_hash; and originator (a party index) on transferred calls | One per recorded conversation. A call that was transferred has one recording per agent. |
transfer | start, transferor, transferee, transfer_target (party indexes), original, target_dialog (dialog indexes) | Between consecutive recordings of a transferred call. |
incomplete | start, duration, parties, disposition | A 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. |
urlis 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_hashissha512-followed by the URL-safe base64 SHA-512 of the file.urlandcontent_hashcan benullif 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.
attachments[0]: the Comcent call record
Section titled “attachments[0]: the Comcent call record”purpose is "comcent.call_story", encoding is "json" and body is an object:
| Field | Type | Description |
|---|---|---|
id | string | Call story id (same as uuid). |
org_id | string | Your organisation’s id. |
start_at, end_at | string | Start and end of the call. |
caller, callee | string | E.164 number or member SIP address. |
outbound_caller_id | string or null | Caller ID used on an outbound call. |
direction | string | inbound or outbound. |
hangup_party | string or null | Who hung up first. |
is_transcribed, is_summarized, is_sentiment_analyzed, is_anonymized | boolean | Processing state. |
legs | array | One 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:
| Field | Type | Description |
|---|---|---|
id | string | Span id. |
type | string | DIAL_WAIT (call set-up), RINGING (an agent’s phone rang), QUEUED (waiting in a queue), ON_CALL, HOLD, RECORDING. |
channel_id | string | The leg this span belongs to. |
start_at, end_at | string | Start and end; end_at may be null. |
current_party | string | Whose leg it is. |
call_story_id | string | The call story id. |
metadata | object or null | RECORDING: 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. |
analysis[]
Section titled “analysis[]”Present only when AI Insights processed the call. Every entry has vendor: "comcent" and schema: "comcent.deepgram.nova2.v1".
type | encoding | body |
|---|---|---|
sentiment | json | [{ current_party, sentiment, sentiment_score }], one per party. sentiment is positive, neutral or negative. |
transcript | json | [{ current_party, start, message }], one per turn. start is a Unix timestamp in seconds. |
summary | none | The summary as plain text. |
PRESENCE_UPDATE
Section titled “PRESENCE_UPDATE”{ "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.