Saltar al contenido principal

About This Event

The on_call_end webhook is triggered at the conclusion of a call in the Altur platform. This webhook provides detailed information about the call, the agent involved, and the campaign user. Use this webhook to keep your backend or CRM updated with the latest call data.

Event Details

  • Trigger: Automatically triggered at the end of a call.
  • Purpose: To update your backend or CRM with call status, transcript, recording URL, and user information.

Request Details

  • HTTP Method: POST
  • Content Type: application/json
  • Endpoint: The URL you configure in your webhook integration settings.
  • Authentication: Includes the X-Altur-Signature header for HMAC verification.

Payload Example

Here’s an example of the payload sent with the on_call_end event:
{
  "event_type": "on_call_end",
  "id": "cll_gBoLtd02pUI50QwXkFjB",
  "type": "outbound",
  "status": "ended",
  "phone_number_from": "+000000000000",
  "phone_number_to": "+000000000000",
  "answered_by": "human",
  "created_at": "2024-12-19T15:00:10Z",
  "started_at": "2024-12-19T15:00:10Z",
  "ended_at": "2024-12-19T15:00:10Z",
  "duration": 45,
  "billed_duration": 45,
  "recording_url": "https://api.altur.io/api/v1.0/call/cll_gBoLtd02pUI50QwXkFjB/recording",
  "transcript": [
    {
      "sent_by": "assistant",
      "sent_at": "2024-12-19T15:00:00Z",
      "content": "Hello am I speaking with Sofía?"
    },
    {
      "sent_by": "user",
      "sent_at": "2024-12-19T15:00:10Z",
      "content": "Yes, who is this?"
    }
  ],
  "assistant": {
    "id": "6cy951e6-9877-4d7c-88d7-56b4948d3cce",
    "nickname": "DebtCollectorBot",
    "name": "Diana Arroyo"
  },
  "end_user": {
    "id": "2be951e6-7798-47cd-878d-49b2918a3bba",
    "status": "converted",
    "display_name": "John Doe",
    "phone_number": "+521234567890",
    "context": "Customer data...",
    "extracted_data": {
      "Payment Amount": "1200",
      "Payment Date": "2024-12-26",
      "Payment Medium": "app"
    },
    "tags": ["payment_promise", "call_later"]
  },
  "campaign_user": {
    "f_id": "user_12345",
    "name": "John Doe",
    "contact": "+521234567890",
    "context": "Customer data for campaign...",
    "status": "converted",
    "failed_retries": 0,
    "voicemail_retries": 1,
    "extracted_data": {
      "Payment Amount": "1200",
      "Payment Date": "2024-12-26",
      "Payment Medium": "app"
    },
    "tags": ["payment_promise", "call_later"]
  }
}

Root Fields

FieldTypeDescription
event_typestringEvent type (on_call_end).
idstringUnique identifier for the call.
typestringCall type (outboundor inbound).
statusstringStatus of the call enum value (e.g., ended).
phone_number_fromstringE.164 formatted number.
phone_number_tostringE.164 formatted number.
answered_bystringIndicates who answered the call (human, machine or unknown).
created_atdatetimeISO formatted date time of when the call was created.
started_atdatetimeISO formatted date time of when the call started.
ended_atdatetimeISO formatted date time of when the call ended.
durationintCall duration in seconds.
billed_durationintBilled call duration in seconds.
recording_urlstringURL to download the call recording.
transcriptarrayCall transcript object.

Assistant Object

FieldTypeDescription
iduuidUnique identifier for the assistant.
nicknamestringAssistant’s nickname.
namestringAssistant’s name.

End User Object

Deprecated: The end_user object is deprecated and will be removed in a future version. Please use the campaign_user object instead for campaign-related calls.
FieldTypeDescription
iduuidUnique identifier for the end user.
statusstringCurrent status of the user enum value (e.g., converted).
display_namestringDisplay name of the user.
phone_numberstringUser’s phone number (E.164 format).
contextstringAdditional user-specific information.
extracted_dataobjectKey-value pairs of extracted data.
tagsarrayArray of tag names corresponding to tags assigned to the last campaign user or current thread.

Campaign User Object

FieldTypeDescription
f_idstringForeign identifier for the campaign user from your system.
namestringName of the campaign user.
contactstringContact phone number (E.164 format).
contextstringAdditional campaign user-specific information.
statusstringCurrent status of the campaign user (e.g., converted).
failed_retriesintNumber of failed retry attempts.
voicemail_retriesintNumber of voicemail retry attempts.
extracted_dataobjectKey-value pairs of data extracted during the call.
tagsarrayArray of tag names assigned to the campaign user.

Response Expectations

Your endpoint should return a 200 OK status code to confirm receipt of the webhook. For information on retry behavior in case of failures, see the Retry Policy section in the Webhook Overview.

Security

Each request includes an HMAC signature in the X-Altur-Signature header. Refer to the Securing Your Webhooks section for instructions on validating webhook requests.

Example Use Cases

  1. CRM Integration Use the on_call_end webhook to update call logs and user interaction data in your CRM system.
  2. Analytics Process transcripts and user status to generate insights or trigger follow-up actions.
  3. Data Enrichment Automatically store extracted data, like account numbers or due dates, in your system for further use.