Skip to main content

AccountEndedCalls

Fires when a call finishes, for the whole account. This is the event to write to a call log or a CRM: it is the record of what actually happened, including every leg the call passed through.

Compare UserEndedCalls, which is the same event scoped to one user's perspective and without the leg breakdown.

Payload

The call's summary fields, plus a cdrs array — one entry per leg.

{
"callId": "1754489201.884213",
"direction": "inbound",
"status": "answered",
"callerType": "external",
"callerName": "ACME ROOFING",
"callerNumber": "13475550123",
"calledType": "user",
"calledName": "Dana Spencer",
"calledNumber": "204",
"dialledNumber": "12125550188",
"startTime": "2026-08-11T13:20:01Z",
"callDuration": 238,
"talkDuration": 220,
"agentOnCall": false,
"webhookType": "AccountEndedCalls",
"externalCallerId": "12125550188",
"externalCallerName": "Acme Inc",
"recordingUrl": "https://api.account.telebroad.com/recordings/play/9f2c…",
"cdrs": [
{
"uniqueId": "1754489201.884213",
"callId": "1754489201.884213",
"status": "answered",
"startTime": "2026-08-11T13:20:01Z",
"endTime": "2026-08-11T13:21:37Z",
"callDuration": 96,
"talkDuration": 81,
"callerType": "external",
"callerNumber": "13475550123",
"callerName": "ACME ROOFING",
"calledType": "user",
"calledNumber": "204",
"recordingUrl": "https://api.account.telebroad.com/recordings/play/9f2c…"
}
]
}

Call fields

FieldTypeDescription
callIdstringThe call id — matches call history, reports and the recordings endpoint.
directionstringinbound or outbound.
statusstringHow the call ended — answered, missed, and so on.
callerType / callerName / callerNumberstringThe calling party.
calledType / calledName / calledNumberstringThe called party.
dialledNumberstringWhat was actually dialled — for an inbound call, your DID.
startTimestringRFC 3339 UTC.
callDurationintegerSeconds, including ringing.
talkDurationintegerSeconds connected. Closer to the length of any recording.
agentOnCallbooleanWhether an agent was on the call.
externalCallerId / externalCallerNamestringThe external caller ID presented.
recordingUrlstringSigned playback link. Absent when nothing was recorded.
webhookTypestringAlways AccountEndedCalls.
cdrsarrayOne entry per leg — see below. Absent when there is nothing to break down.

cdrs[] — one entry per leg

FieldTypeDescription
uniqueIdstringThe leg identifier. Matches uniqueId from the recordings endpoint.
callIdstringThe switch's call id for this leg — can differ from the top-level one.
statusstringHow this leg ended.
startTime / endTimestringRFC 3339 UTC. endTime is absent on a leg that did not complete normally.
callDuration / talkDurationintegerSeconds, per leg.
callerType / callerNumber / callerNamestringThis leg's calling party.
calledType / calledNumberstringThis leg's called party.
callerIdInternal / externalCallerIdstringPresent when set.
callerNameInternal / externalCallerNamestringPresent when set.
bridgedFromCallIdstringThe call this leg was bridged from — this is how you follow a transfer.
recordingUrlstringSigned playback link for this leg. Absent if the leg was not recorded.

Why cdrs matters

A call that rang a queue, was answered and was transferred is one callId and several legs. The top-level fields describe the call; cdrs describes what happened inside it.

  • Who really handled it — the last leg with talk time, not the first.
  • How long the caller waited — the gap between the call's startTime and the answered leg's.
  • Following a transfer — chain on bridgedFromCallId.
  • Which audio to play — each leg carries its own recordingUrl; there is usually no single "the recording".

Gotchas

  • recordingUrl is absent, not empty, when nothing was recorded.
  • A recording URL needs no credential and never expires. Treat it as a secret — see Recordings.
  • This fires for internal extension-to-extension calls too. Filter on direction and callerType if you only want external traffic.
  • recordingUrl can be present before the audio is fetchable. It is written after hangup — retry with backoff rather than treating an immediate miss as "no recording".