on_call_ended_url, Clarity sends a POST to that URL after the call ends. The body is the call’s vCon document: who took part, every line of the transcript, the tool calls the agent made, and the fields it extracted.
When it is sent
- Only for calls placed with
dispatch-calland anon_call_ended_url. Campaign calls and inbound calls do not send it. - After the call has ended and its record has been written. If your organization redacts personal data from calls, the vCon is written after redaction, so the webhook carries the redacted text.
- Not at all for a call that left no record. A call where the agent never produced a recording or transcript, for example because the session failed before it started, has no vCon to send.
The webhook is a notification, not a guaranteed delivery. Keep a fallback that reads conversations you have not heard back about:
GET /v1/projects/{projectId}/conversations/{conversationId}. See Follow the call.The request
Because the request is not signed, treat the URL itself as the secret: include a long random token in its path or query string, and reject requests that do not carry it. Use the
conversation_id in the body to fetch the conversation from the API if you need to confirm it is real.
Delivery and retries
- Each attempt waits up to 4 seconds for your response. Answer quickly and process the body afterwards.
- Any
2xxanswer counts as delivered. - A
4xxanswer is not retried. - A
5xxanswer, a timeout or a network error is retried once, about half a second later. - If both attempts fail, a later stage of Clarity’s own call-end processing may try again. Do not rely on it.
- After a successful delivery Clarity does not send the same call again. In rare failure cases a second delivery is possible, so make your handler idempotent: the vCon
uuidis the same for every delivery of one conversation.
The vCon document
A trimmed example for an outbound call where the agent looked up free slots:Top level
string
Derived from the conversation id, so it is the same for every delivery of one call. Use it to de-duplicate.
string
The vCon syntax version.
string
When the call ended (ISO 8601).
updated_at carries the same value.parties
The people and agents on the call, referenced by their index everywhere else in the document.
- Index 0 is always the customer. It has
telwhen the phone number is known. It may have ametaobject withcontact_name(the name a campaign item carried),gender(when the agent inferred it) orcustomer_id(a matched support contact). Most calls have nometa. - Indexes 1 and up are agents. Each has
name(the agent’s display name) anduuid(the agent id). A call handed from one agent to another lists each agent once.
dialog
The transcript, then the recording.
- Each spoken line is a
textentry, in time order.originatorandpartieshold the speaker’s party index,bodyholds the words, andstartis when the line began.durationis the number of seconds until the next line starts; the last line has none.message_idis stable for the same line across deliveries. - The last entry is the
recording, with the call’sdurationin seconds. Itsurlis Clarity’s internal storage location and cannot be downloaded. To get the audio, request a signed link from the API: see Conversations and recordings.
attachments
One attachment, purpose: "clarity_call_context". Its body is a JSON object (encoding: "none"):
analysis
Each entry’s body is a JSON-encoded string (encoding: "json"). Parse it before use. An entry appears only when it has something to say.
What is not in the vCon
- The call summary. Summaries are written after the call ends, separately from the vCon. Read
conversation_summaryfromGET /v1/projects/{projectId}/conversations/{conversationId}oncesummary_statusisgenerated. - Metrics such as token counts and latency. See Conversations and recordings.
A minimal receiver
queueForProcessing stands for your own job queue. Register the URL with the token in it, for example https://hooks.example.com/clarity/call-ended/7b4f…, as the on_call_ended_url.