call.ended
A conversation with an agent finished.
Sent once per conversation, by phone or on the website widget, shortly after it ends: Ovianta first finishes analysing the call. When the call was transferred to a person, Ovianta also waits for the transfer's result, for up to 10 minutes.
What it tells you
- Who and where: the agent, the center, and the patient, with your own patient id in
call.patient.externalIdwhen the agent identified them in your system. - How it went:
outcomesays whether anyone talked to the agent, andendedBywho hung up. - What changed:
actionslists what the agent did in your agenda or for the clinic, in order: appointments booked, moved, cancelled or confirmed, patients registered, notes left, transfers. Lookups are not listed. A failed action carries anerror. - What was said:
transcript, turn by turn, with the tools the agent used on each turn.
A note the agent left during the call appears both as a create_note action here and as its own note.created event.
Payload
data fields (version 1)
Prop
Type
Example body
{
"event": "call.ended",
"eventId": "evt_3f9c2a7d41b8e6c05a1d9e2f",
"version": 1,
"sentAt": "2026-09-01T11:39:45.000+02:00",
"attempt": 1,
"data": {
"agent": {
"id": "6801234abcde5f6789012345",
"name": "Reception",
"type": "appointments_booking"
},
"center": {
"id": "6801234abcde5f6789099999",
"name": "Sede Centro",
"externalId": "1"
},
"call": {
"id": "68f0c1d2e3f4a5b6c7d8e9f0",
"direction": "inbound",
"channel": "phone",
"modality": "voice",
"startedAt": "2026-09-01T11:36:05.000+02:00",
"endedAt": "2026-09-01T11:39:41.000+02:00",
"durationSecs": 216,
"outcome": "completed",
"endedBy": "agent",
"phone": {
"from": "+34654654654",
"to": "+34932556677",
"patient": "+34654654654"
},
"patient": {
"id": "68f0c0a1b2c3d4e5f6a7b8c9",
"externalId": "345345",
"name": "Marta Ruiz"
},
"transfer": null,
"actions": [
{
"type": "create_appointment",
"status": "executed",
"appointmentId": "56834",
"patientId": "345345",
"appointment": {
"startsAt": "2026-02-16T16:00:00+01:00",
"doctorId": "24895",
"serviceId": "1",
"centerId": "1"
}
},
{
"type": "create_note",
"status": "executed",
"note": {
"id": "68f0c2a1b4e5d6f7a8b9c0d1",
"createdAt": "2026-09-01T11:39:30.000+02:00",
"callId": "68f0c1d2e3f4a5b6c7d8e9f0",
"patientName": "Marta Ruiz",
"phone": "+34654654654",
"callReason": "Wants to know whether her insurance covers cataract surgery.",
"fields": [
{
"key": "insurance",
"label": "Insurance",
"value": "Adeslas"
},
{
"key": "urgent",
"label": "Urgent",
"value": false
},
{
"key": "preferred_time",
"label": "Best time to call back",
"value": null
}
]
}
}
],
"transcript": [
{
"role": "agent",
"at": 0,
"text": "Clínica Sede Centro, buenos días. ¿En qué puedo ayudarle?"
},
{
"role": "patient",
"at": 4,
"text": "Quería pedir cita para una revisión de la vista."
},
{
"role": "agent",
"at": 9,
"toolCalls": [
{
"name": "search_patient",
"status": "success"
}
]
},
{
"role": "agent",
"at": 15,
"toolCalls": [
{
"name": "get_availability",
"status": "success"
}
]
},
{
"role": "agent",
"at": 16,
"text": "Tengo hueco el lunes 16 a las cuatro de la tarde con el doctor Pérez. ¿Le va bien?"
},
{
"role": "patient",
"at": 21,
"text": "Sí, perfecto."
},
{
"role": "agent",
"at": 22,
"toolCalls": [
{
"name": "create_appointment",
"status": "success"
}
]
}
]
}
}
}