endCall doesnt work
# support
s
It was already brought up here I think: https://discord.com/channels/1211482211119796234/1349827929571590234/1349827929571590234 The issue is the following: when creating an assistant via the api and the goal is to enable the endcall function. e.g sth like this: { "model": { "provider": "openai", "model": "gpt-3.5-turbo", "messages": [ { "role": "system", "content": "You are an assistant at a law firm. If the user is being mean, use the endCall function." } ], "tools": [ { "type": "endCall" } ] } } then the created assistant (when checking the assistant in the vapi dashboard) has the endCall toggle still disabled. So this functionality must not work from the API. I tried to debug but cant figure out why. Even when I used the https://docs.vapi.ai/api-reference/assistants/create/~explorer and used the official structure, it worked only to create the assistant etc but not with the endCall function enabled. timestamp is: 23 April, 7pm CET
v
Try setting the model temperature to 0.3 when creating your assistant via the API, as this is important for the
endCall
function to work correctly:
Copy code
json
{
  "model": {
    "provider": "openai",
    "model": "gpt-3.5-turbo",
    "temperature": 0.3,
    "messages": [
      {
        "role": "system",
        "content": "You are an assistant at a law firm. If the user is being mean, use the endCall function."
      }
    ],
    "tools": [
      {
        "type": "endCall"
      }
    ]
  }
}
According to information found in Discord discussions, updating the model temperature is important for this functionality. Source: - [Discord discussion about endCall function](https://discord.com/channels/1211482211119796234/1341663336621674558)
s
This didnt help. To provide more context (I am using the official api documentation under https://docs.vapi.ai/api-reference/assistants/create/~explorer - but also tried from the API directly, both didnt work).
request: // Create Assistant (POST /assistant) const response = await fetch("https://api.vapi.ai/assistant", { method: "POST", headers: { "Authorization": "Bearer xxxxxxx", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "test55", "firstMessage": "Hallo, hier spricht der automatisierte Empfang von xxxx. Was kann ich für Sie tun?", "transcriber": { "provider": "deepgram", "model": "nova-2", "language": "de", "numerals": true }, "voice": { "provider": "11labs", "voiceId": "tLPh1ULk9PH3P3AuK6rm", "model": "eleven_flash_v2_5" }, "model": { "provider": "openai", "model": "gpt-4o-mini", "temperature": 0.3, "maxTokens": 250, "tools": [ { "type": "endCall" }, { "type": "transferCall", "destinations": [ { "type": "number", "number": "+4975122222", "description": "Transfer to a human" } ] } ], "messages": [ { "role": "system", "content": "[Identität] Sie sind eine freundliche und sachkundige Assistentin der per .... das Problem so schnell wie möglich behoben wird.\\n\\n[Anrufbeendigung]\\n• Danken Sie dem ..... alle Fragen geklärt sind." }, { "role": "function", "content": "endCall function should be used if person is rude" } ] } }), }); const body = await response.json(); console.log(body);
Response: (cut some sensitive data): { "id": "XXXX", "orgId": "XXXX", "name": "test55", "voice": { "model": "eleven_flash_v2_5", "voiceId": "tLPh1ULk9PH3P3AuK6rm", "provider": "11labs" }, "createdAt": "2025-04-23T17:48:20.232Z", "updatedAt": "2025-04-23T17:48:20.232Z", "model": { "model": "gpt-4o-mini", "tools": [ { "type": "endCall" }, { "type": "transferCall", "destinations": [ { "type": "number", "number": "+4975122222", "description": "Transfer to a human" } ] } ], "messages": [ { "role": "system", "content": "[Identität] Sie sind .. ...obald alle Fragen geklärt sind." }, { "role": "function", "content": "endCall function should be used if person is rude" } ], "provider": "openai", "maxTokens": 250, "temperature": 0.3 }, "firstMessage": "Hallo, hier spricht der automatisierte Empfang von XXX. Was kann ich für Sie tun?", "transcriber": { "model": "nova-2", "language": "de", "numerals": true, "provider": "deepgram" }, "isServerUrlSecretSet": false }
k
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
s
shared all of the above already in the chat
anything else you need from me?
k
just wanted to confirm you want to report that when creating an assistant via the API with the endCall function included in the tools array, the endCall toggle in the Vapi dashboard still shows as disabled. Even though the assistant was successfully created through the API with the endCall tool configuration, the dashboard UI wasn't properly reflecting this setting. if true, then this is a disconnect between the API configuration and how the dashboard UI interprets the endCall functionality setting.
s
@Shubham Bajaj yes exactly. that is the issue
And seems to be at least not only an isue for me based on some other threads
k
is this strictly a UI issue or is the endCall function not being called at all? I just want to make sure this is reported correctly.
s
I think it is a UI issue. The same thing happens for the transerCall function as well btw - this doesnt work for me at all.
4 Views