Skip to navigation

Configure the Hang Up tool

Set the goodbye message, attach the tool to an assistant, and guard against calls that end too early

This page shows how to configure each part of the Hang Up tool. To build a working assistant first, see the Hang Up tool quickstart.

Prerequisites

  • A Vapi account
  • A Vapi API key for the cURL examples
  • An assistant to attach the tool to

Create the tool

1

Create a Hang Up tool

Open the Dashboard, select Tools, select Create Tool, then choose Hang Up.

The Dashboard creates the tool when you choose Hang Up and names it end_call_tool.

Vapi Dashboard Create Tool menu with Hang Up under Phone Call Tools
Choose Hang Up from the Create Tool menu
2

Describe the tool

Under Tool Settings, use Description to say when the assistant should end the call. The model reads the description when it decides whether to call the tool.

Description
Ends the call. Use only after the caller confirms they have nothing else to ask.
Vapi Dashboard Tool Settings with Tool Name endCall and a description
Describe the Hang Up tool
3

Publish the tool

Select Publish, review the changes, select Next, then select Publish.

Set the goodbye message

The tool’s request-start message, set in the tool’s messages array, is what the assistant says before Vapi ends the call. If the tool has a request-start message, the assistant says that message and ignores its End Call Message (endCallMessage).

If the tool has no messages, the assistant says its end call message. If no end call message is set, the assistant says “Goodbye” in the transcriber’s language.

Use a request-start message for the goodbye. Request Failed and Request Response Delayed messages aren’t used by the Hang Up tool.

1

Find the Request Start message

Open the tool and expand Messages. A new Hang Up tool includes a Request Start message set to Default. If the tool has no Request Start message, select Add Message, then choose Request Start.

2

Enter the goodbye

Set Message Option to Custom, then enter the goodbye:

Request Start
Thanks for calling. Goodbye.
Vapi Dashboard Messages section with a Request Start message set to Custom: Thanks for calling. Goodbye.
Set a custom Request Start goodbye

To vary the goodbye, add more variants. The assistant says one variant each time the tool runs.

To end the call without a goodbye, set Message Option to None. The Default option also ends the call without a goodbye, because it saves the message without content.

To use the assistant’s End Call Message or “Goodbye” instead, don’t add a Request Start message.

3

Publish the tool

Select Publish, review the changes, select Next, then select Publish.

Don’t also tell the model to say goodbye in its system prompt. If the model says goodbye and then calls the tool, the caller hears two goodbyes.

Attach the tool to an assistant

An assistant can have one Hang Up tool.

1

Add the tool

Select Assistants, then select your assistant. Open the Tools tab, select Add tool, then choose the Hang Up tool.

Vapi Dashboard assistant Tools tab with the Add tool picker showing endCall
Choose the Hang Up tool from Add tool
Vapi Dashboard assistant Tools tab listing the endCall tool
The Hang Up tool attached to the assistant
2

Publish the assistant

Select Publish, review the changes, then select Quick Publish.

With a custom LLM, return a tool call named endCall to end the call. The Hang Up tool must be attached to the assistant.

Tell the model when to end the call

The model decides when to call the Hang Up tool, so most unexpected endings start in the system prompt. State when to end the call and when not to:

System prompt excerpt
When the caller's request is resolved, ask whether they need anything else. If they say no, call the endCall tool. Do not say goodbye yourself; the tool says it.
Do not end the call when the caller disagrees with you, asks a follow-up question, asks you to wait, or asks you to repeat something.

Refer to the tool by its Tool Name. Tools created in the Dashboard start with the name end_call_tool. Tools created through the API without a name use endCall. For more on writing tool instructions, see Integrate tools and APIs in the prompting guide.

Prevent early hang-ups with a rejection plan

A rejection plan blocks the tool call when a condition matches recent messages. Use it as a guard in addition to prompt rules, not as a replacement for them. Configure rejection plans through the API with the tool’s rejectionPlan field.

The following rejection plan blocks the Hang Up tool when the caller’s most recent message asks the assistant to wait or says they have another question:

curl --request PATCH \
--url "https://api.vapi.ai/tool/YOUR_TOOL_ID" \
--header "Authorization: Bearer $VAPI_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"rejectionPlan": {
"conditions": [
{
"type": "regex",
"regex": "(?i)\\b(wait|hold on|one more question|another question)\\b",
"target": { "position": -1, "role": "user" }
}
]
}
}'

When Vapi rejects the tool call, the call continues. See Tool rejection plan for regex, Liquid, and grouped conditions.

Add end call phrases as a fallback

If the assistant sometimes says goodbye without calling the tool, add a few specific end call phrases to the assistant with End Call Phrases under Advanced in the Dashboard, or the endCallPhrases field in the API. Use complete closing sentences, such as Thanks for calling. Goodbye., so the phrase does not match ordinary speech.

Verify how the call ended

Select Logs, then open the call. See Call logs. When the Hang Up tool ended the call, the ended reason is assistant-ended-call.

Troubleshoot unexpected call endings

SymptomLikely causeWhat to check
The assistant says goodbye but the call stays openThe model said goodbye in its own words and did not call the tool.Tell the model to call the tool instead of saying goodbye, or add a specific end call phrase as a fallback.
The call ends too earlyThe model called the tool while the caller still needed help.Add “do not end the call when…” rules to the prompt and a rejection plan for the caller’s last message.
The caller hears two goodbyesThe prompt and the tool both say goodbye.Remove the goodbye from the prompt and keep the tool’s request-start message.
The call ends without a goodbyeThe tool’s request-start message has no content, for example when Message Option is None or Default.Set Message Option to Custom and enter the goodbye.

See Call end reasons for the complete list of ended reasons.