End-Call Reasons

End-Call Reasons let you define custom conditions that trigger automatic call termination. When the AI agent detects one of these conditions during a conversation, it says a brief farewell and ends the call. This feature works with both simple prompt and Flow Designer agents.

How it works

End-call reasons are evaluated by the AI agent on every conversational turn. The agent compares the current context of the conversation against the configured reasons and decides whether any condition has been met.

  • Simple prompt agents: End-call reasons are registered as an OpenAI function tool. The agent can invoke the end_call tool at any point when it detects a matching condition.
  • Flow Designer agents: An end_call <actual reason> command is injected into the prompt for every state type (utterance, slot collection, action, transfer, terminal). The agent can issue this command whenever a condition is met. End-call conditions are also checked via a global evaluation step before each state transition, so they work even in verbatim utterance states that skip normal LLM processing.
End-call reasons work alongside the built-in goodbye detection, which automatically ends calls when both parties exchange farewell expressions. Custom end-call reasons give you additional control for specific scenarios beyond normal conversation endings.

Configuring end-call reasons

Dashboard

In the agent editor, open Global Settings and expand the End-Call Reasons accordion. Add each reason as a tag by typing the condition and pressing Enter.

Examples of useful end-call reasons:

  • “Customer is being abusive or threatening”
  • “Caller is asking for something outside our scope”
  • “Fraud detected”
  • “Wrong number”

API

Include the end_call_reasons field when creating or updating an agent:

1{
2 "end_call_reasons": [
3 "Customer is being abusive",
4 "Fraud detected",
5 "Wrong number"
6 ]
7}

Flow Builder

In the Global Settings node, expand the End-Call Reasons section and add reasons using the modal interface.

Post-call data

When a call is terminated by an end-call reason, the post-call webhook includes:

FieldValue
end_call_reason"normal"
custom_end_call_reasonThe specific reason that triggered the termination (e.g., "Customer is being abusive")

The custom_end_call_reason field is only present when the call was ended by an end-call reason.