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_calltool 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.
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:
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:
The custom_end_call_reason field is only present when the call was ended by an end-call reason.