Skip to main content
When you dispatch a call with 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-call and an on_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 2xx answer counts as delivered.
  • A 4xx answer is not retried.
  • A 5xx answer, 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 uuid is 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 tel when the phone number is known. It may have a meta object with contact_name (the name a campaign item carried), gender (when the agent inferred it) or customer_id (a matched support contact). Most calls have no meta.
  • Indexes 1 and up are agents. Each has name (the agent’s display name) and uuid (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 text entry, in time order. originator and parties hold the speaker’s party index, body holds the words, and start is when the line began. duration is the number of seconds until the next line starts; the last line has none. message_id is stable for the same line across deliveries.
  • The last entry is the recording, with the call’s duration in seconds. Its url is 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_summary from GET /v1/projects/{projectId}/conversations/{conversationId} once summary_status is generated.
  • 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.