Skip to navigation

Webhook events

Summary

This page lists every webhook event type, the headers of each request, the event envelope and the body size rules. It does not cover endpoints, signature checks, retries or resends; see Receive call events with webhooks.

EventSent whenPayload schema
call.completedA connected call (media was accepted) left active. Once for each call. Call.end_reason says why it ended, for example agent_hangup when the agent ended the call or line_dropped when the line of an answered call failed. The transcript is not in this event; it comes with call.analyzed.CallCompletedEvent. data is WebhookCallData (call) or WebhookReducedCallData
call.failedA call ended without connecting: it was aborted, or it ended with no media accepted. Once for each call. Call.dial_outcome and Call.dial_sip_code say why. A call gets exactly one of call.completed and call.failed.CallFailedEvent. data is WebhookCallData (call) or WebhookReducedCallData
call.analyzedOnly for a call that got call.completed. Once, when the transcript, the recording state and the extraction are final, or 6 hours after the call ended, whichever comes first. A later repair or re-analysis sends no second event.CallAnalyzedEvent. data is WebhookCallAnalyzedData or WebhookReducedCallData
webhook.testsendWebhookTestEvent created it, for one endpoint only, whatever the events list of that endpoint. An endpoint cannot subscribe to it.WebhookTestEvent. data.message is a string

Request headers

Each request is a POST with these headers.

HeaderValue
content-typeapplication/json
user-agentRasen-Webhooks/1.0
webhook-idThe event id (WebhookEvent.id), wevt_ and 26 characters. The same value on every attempt, retry and resend of that event
webhook-timestampUnix time in seconds of this attempt, not of the event. 1 to 12 digits
webhook-signatureOne or two space-separated values, each v1,<base64 HMAC-SHA256>, at most 256 characters. Two values during a rotation grace period: one for the current secret, one for the previous secret
Signature inputValue
Signed content{webhook-id}.{webhook-timestamp}.{body}, where body is the exact request bytes
HMAC keyThe base64-decoded part of the secret after whsec_ (32 bytes)
AlgorithmHMAC-SHA256

Envelope

Every event body is a JSON object with these fields (WebhookEventEnvelope).

FieldTypeValue
idstringThe event id, equal to the webhook-id header (prefix wevt_)
typestringcall.completed, call.failed, call.analyzed or webhook.test. Open vocabulary
created_atstring (date-time)When the event was created, UTC RFC 3339 with milliseconds
workspace_idstringThe workspace of the event
api_versionstringThe public API version whose schemas built data, fixed at fan-out
dataobjectThe payload of the event type

Payload fields

SchemaFieldValue
WebhookCallDatacallThe Call
WebhookCallAnalyzedDatacallThe Call
WebhookCallAnalyzedDatatranscript.turnsThe turns of the selected transcript, in order. Call.transcript_state tells ready from absent
WebhookCallAnalyzedDatatranscript.truncatedtrue when turns was emptied to keep the body under 1 MiB
WebhookCallAnalyzedDataextractionWhat getCallExtraction returns at fan-out, with its state; null only when that read finds no result
WebhookCallAnalyzedDatasummaryWhat getCallSummary returns at fan-out, with its state, or null. The event does not wait for the summary
WebhookCallAnalyzedDatarecording.availabletrue when a verified recording exists. The body never carries a recording URL; use downloadCallRecording
WebhookReducedCallDatacall_idThe id of the call
WebhookReducedCallDatatruncatedAlways true
WebhookTestEvent datamessageA string, for example This is a test event from Rasen.

Body size and reduced form

RuleValue
Maximum body size1 MiB
call.analyzed over 1 MiBtranscript.turns is emptied first, and transcript.truncated is true
Any call event still over 1 MiBThe reduced form: data is WebhookReducedCallData (call_id, truncated: true)
When the body is builtOnce, at fan-out, with the public serializers. It describes the call as it was at that moment
Attempts and resendsEvery attempt and resend of one event sends the same bytes
Never in a bodyRecording URLs, signals, prompts, credentials, full phone numbers and data of another workspace