Call server URL at end of call
# support
m
Im using a server endpoint but I only want it to be triggered at the end of the call, but when I look at my call log i see it being triggered multiple times during the call. How can I make it so that it only triggers at the end of the call? Also I've noticed that there is a ServerURL field in the advanced section of the assistant and also in the API Keys page. Do I only use the one in the assistant advanced section?
v
Hi @MaxKnox, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Create Assistant]() * [Get Assistant]() * [Update Assistant]() * [List Assistants]() -----------------------------
### Answer To ensure that your server URL is triggered only at the end of the call, you should configure the
serverMessages
to include only the
end-of-call-report
. This setting is adjusted when you create or update your assistant, and specifies which events should trigger server notifications. By default, several events may trigger server notifications, which could be why you're seeing multiple triggers in your call log [(1)]() . Regarding where to set the server URL, you have multiple options depending on the desired scope and granularity. If you set the server URL at the assistant level in the advanced settings, it will apply specifically to that assistant. This can be done either through the dashboard or via the API when creating or updating an assistant [(2)]() . If you set the server URL in the API Keys page, it applies more broadly at the account level. Typically, you would use the server URL in the assistant's advanced section if you need different endpoints for different assistants or specific interactions. Here’s how you might adjust the
serverMessages
to include only
end-of-call-report
for triggering at the end of the call:
Copy code
json
{
  "serverMessages": ["end-of-call-report"]
}
[(1)]() This configuration ensures that your server URL is triggered only once, capturing the final state and any concluding data from the call session.
m
would it not be good to add the transcript to serverMessages?
v
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
3 Views