End-of-call report - add structured object
# support
m
I have set up a webhook for an end-of-call report. That works fine. I then tried to add a structured output to the assistant, hoping that it would be included with the end-of-call report. Unfortunately, even though things look good syntactically, that structured output object is not being returned with the end-of-call report (likely because it takes a few seconds, given the LLM call). Can I set up a webhook to fire when that structured object has been created? It seems like that is NOT an option (given the documentation)
v
You are correct: there is currently no webhook that fires when a structured output is completed. The recommended approach is to poll the call data via API a few seconds after receiving the end-of-call report to retrieve the structured outputs.
Copy code
javascript
// After receiving end-of-call webhook
setTimeout(async () => {
  const call = await vapi.calls.get(callId);
  const structuredOutputs = call.artifact?.structuredOutputs;
  // Process structured outputs here
}, 5000); // Wait 5 seconds for processing
This polling method is the best available workaround until a dedicated webhook is introduced. Sources: - [Structured outputs quickstart](https://docs.vapi.ai/assistants/structured-outputs-quickstart) - [Server events](https://docs.vapi.ai/server-url/events)
v
Message marked as helpful by @MdotMoment11! 🎉
c
Hi MdotMoment11, You can programmatically end a call by using the
end-call
message type in the
ClientInboundMessage
. Include a message with the
type
property set to
"end-call"
when sending inbound messages. For more details, refer to the [documentation](https://docs.vapi.ai/changelog/2025/1/14). Let us know if you need anything else.
2 Views