For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Connect
BlogHelp CenterAPI PricingSign up
OverviewElevenCreativeElevenAgentsElevenAPIReception AIAPI referenceChangelog
OverviewElevenCreativeElevenAgentsElevenAPIReception AIAPI referenceChangelog
  • Get started
    • Overview
    • Quickstart
  • Configure
    • Overview
    • Voice & language
    • Knowledge base
    • Tools
      • Client tools
      • Server tools
      • MCP tools
      • System tools
        • End call
        • Language detection
        • Agent transfer
        • Transfer to number
        • Skip turn
        • Play keypad touch tone
        • Voicemail detection
    • Personalization
    • Authentication
  • Deploy
    • Overview
    • Environment variables
    • WhatsApp
    • Batch calls
  • Monitor
    • Overview
    • Users
    • Testing
    • Experiments
    • Versioning
    • Conversation Analysis
    • Analytics
    • Real-time monitoring
    • OpenTelemetry traces
    • Privacy
    • Cost optimization
    • CLI
  • Advanced
    • Events
    • Custom models
    • LLM cascading
    • Post-call webhooks
  • Resources
    • UI components
  • Guides
    • Chat Mode
    • Burst pricing
    • ElevenLabs' docs agent
    • Scaling user interviews
    • Simulate Conversations
LogoLogo
Login
Login
Connect
BlogHelp CenterAPI PricingSign up
On this page
  • Overview
  • Functionality
  • API Implementation
  • Example prompts
ConfigureToolsSystem tools

End call

Let your agent automatically hang up on the user.
Was this page helpful?
Previous

Language detection

Let your agent automatically switch to the language
Next
Built with

The End Call tool is added to agents created in the ElevenLabs dashboard by default. For agents created via API or SDK, if you would like to enable the End Call tool, you must add it manually as a system tool in your agent configuration. See API Implementation below for details.

End call

Overview

The End Call tool allows your conversational agent to terminate a call with the user. This is a system tool that provides flexibility in how and when calls are ended.

Functionality

  • Default behavior: The tool can operate without any user-defined prompts, ending the call when the conversation naturally concludes.
  • Custom prompts: Users can specify conditions under which the call should end. For example:
    • End the call if the user says “goodbye.”
    • Conclude the call when a specific task is completed.

Purpose: Automatically terminate conversations when appropriate conditions are met.

Trigger conditions: The LLM should call this tool when:

  • The main task has been completed and user is satisfied
  • The conversation reached natural conclusion with mutual agreement
  • The user explicitly indicates they want to end the conversation

Parameters:

  • reason (string, required): The reason for ending the call
  • message (string, optional): A farewell message to send to the user before ending the call

Function call format:

1{
2 "type": "function",
3 "function": {
4 "name": "end_call",
5 "arguments": "{\"reason\": \"Task completed successfully\", \"message\": \"Thank you for using our service. Have a great day!\"}"
6 }
7}

Implementation: Configure as a system tool in your agent settings. The LLM will receive detailed instructions about when to call this function.

API Implementation

When creating an agent via API, you can add the End Call tool to your agent configuration. It should be defined as a system tool:

1from elevenlabs import (
2 ConversationalConfig,
3 ElevenLabs,
4 AgentConfig,
5 PromptAgent,
6 PromptAgentInputToolsItem_System
7)
8
9# Initialize the client
10elevenlabs = ElevenLabs(api_key="YOUR_API_KEY")
11
12# Create the end call tool
13end_call_tool = PromptAgentInputToolsItem_System(
14 name="end_call",
15 description="" # Optional: Customize when the tool should be triggered
16)
17
18# Create the agent configuration
19conversation_config = ConversationalConfig(
20 agent=AgentConfig(
21 prompt=PromptAgent(
22 tools=[end_call_tool]
23 )
24 )
25)
26
27# Create the agent
28response = elevenlabs.conversational_ai.agents.create(
29 conversation_config=conversation_config
30)
Leave the description blank to use the default end call prompt.

Example prompts

Example 1: Basic End Call

End the call when the user says goodbye, thank you, or indicates they have no more questions.

Example 2: End Call with Custom Prompt

End the call when the user says goodbye, thank you, or indicates they have no more questions. You can only end the call after all their questions have been answered. Please end the call only after confirming that the user doesn't need any additional assistance.