Assistant Request with Server Side SDK
# support
h
Good afternoon. Is it possible to use Server Assistant Request when using server-side web SDK? If i do not pass an assistant ID, it returns back this error to me: [ERROR] Create call error: Error: API request failed: 400 Bad Request - {"message":"Couldn't Get Assistant. Need Either
assistant
,
assistantId
,
squad
, Or
squadId
.","error":"Bad Request","statusCode":400 I don't see any documentation naratting how i can pass any server-side initiate call attempts to a serverURL the same way we can do it for phone-calling routing. I would have imagined leaving body empty would do the job. Or will doing: "message": { "type": "assistant-request" } to start-call endpoint do the job?
v
Currently, the server-side SDK and web call initiation require you to provide either an
assistant
,
assistantId
,
squad
, or
squadId
in your call request.
The server URL
assistant-request
flow is only documented for inbound phone calls, not for server-side or web SDK calls. As a result, leaving the body empty or sending
{ "message": { "type": "assistant-request" } }
will not trigger a server-side assistant lookup and will result in the error you observed. For server-side initiated calls, you must explicitly provide the assistant configuration or ID in your request. Sources: - [Vapi Docs: Inbound Calls](https://docs.vapi.ai/phone-calling#inbound-calls) - [Vapi Docs: Inbound Support Example](https://docs.vapi.ai/examples/inbound-support#handle-assistant-requests)
h
Have seen some conflicting statements repeatedly from the bot so need a double-check on this
v
Double-check: The
assistant-request
server URL flow is only supported for inbound phone calls. For server-side SDK or web SDK calls, you must provide an
assistant
,
assistantId
,
squad
, or
squadId
in your request—leaving these out or sending a
{ "message": { "type": "assistant-request" } }
payload will result in a 400 error. There is currently no supported way to trigger a server-side assistant lookup for server-initiated calls. See: [Vapi Docs: Inbound Calls](https://docs.vapi.ai/phone-calling#inbound-calls), [Inbound Support Example](https://docs.vapi.ai/examples/inbound-support#handle-assistant-requests) Sources: - [Vapi Docs: Inbound Calls](https://docs.vapi.ai/phone-calling#inbound-calls) - [Vapi Docs: Inbound Support Example](https://docs.vapi.ai/examples/inbound-support#handle-assistant-requests)
v
Hey Huza, when you're using a web SDK you don't need to use server message assistant request. Instead, you can pass the transient assistant with all of the customer data to make the call personalized. Let me know if you have more questions or doubts related to this.
m
Hi Shubham, Will there be any changes in the future to make this possible? The background to this is, for example, the disclosure of the system prompt or tool endpoints in dynamically generated wizards that go beyond simply setting variables.
v
Hey Marcel, I apologize, but I couldn't grasp your explanation about the disclosure of system-prompted tool endpoints in dynamically generated results. Could you please elaborate on it with some examples?