How could I, when a call to an assistant
# general-english
y
How could I, when a call to an assistant starts, trigger something like the end-of-call-report event, but instead at the beginning? I need to extract the caller's number at the start of the call and be able to return some information or something like a webhook.
k
Use the assistant-request event sent to your Server URL, which includes the caller’s number and lets you invoke a webhook or return data before the assistant engages.
y
hi, i make it with status update sent to my server url thanks for the info, but how return data to the assistant , the tool response format not work for this case
k
Request event in Vapi, respond from your server with a JSON containing either "assistantId" to specify a pre-built assistant or an "assistant" object defining a new assistant configuration, since the usual tool response format doesn’t apply here. https://docs.vapi.ai/server-url/events
y
Yes, but I don't want to configure an assistant. I want to respond to information via the webhook of the server URL. I don't know if I'm not explaining myself well. in https://docs.vapi.ai/server-url/events not speak about response
k
If you don’t want to configure an assistant for the assistant-request event, respond from your server with {"error": "No assistant available"} to tell Vapi not to proceed with an assistant.
This tells Vapi that your server isn’t assigning any assistant to handle the call, so the call won’t proceed with an assistant. Unfortunately, the usual webhook response formats for sending data back don’t work because Vapi needs that specific assistant info to continue..
4 Views