call.ended fires when a call involving your agent ends. status is completed, no-answer, canceled, busy, or failed, and ended_at is set.
Read the payload
Thedata object is the CallResult schema from the API contract: one call field holding the full Call object. The envelope around it is the same on every event and is described in the event catalog.
Handle the event
Cancel model work, stop playback and timers, and close the media connection forcall.id. status names the outcome in Twilio’s words. Never revive an ended call.

