Structured outputs quickstart
Overview
This quickstart guide will help you set up structured outputs to automatically extract customer information from phone calls. In just a few minutes, you’ll create a structured output, link it to an assistant, and test data extraction.
What are structured outputs?
Structured outputs are AI-powered analysis and extraction tools that intelligently process conversation data after calls end. They go beyond simple data extraction to provide intelligent analysis and evaluation. They work by:
- Processing complete call context - After the call ends, structured outputs analyze the full transcript, messages, tool call results, and call metadata
- Intelligent extraction & analysis - Based on your schema, they can extract data, evaluate outcomes, analyze sentiment, determine success criteria, and summarize complex interactions
- Validating and formatting - Results are validated against your schema rules and formatted into clean, structured JSON
- Delivering insights - The processed data and insights are available via API or webhooks once analysis is complete
When are structured outputs generated?
Structured outputs are processed:
- After call completion - The full conversation is analyzed once the call ends
- Processing time - Typically completes within a few seconds after call termination
- Available via - Call artifacts in the API response or webhook events
What data do structured outputs have access to?
When processing, structured outputs can analyze:
- Complete transcript - The full conversation between assistant and customer
- Messages history - All messages exchanged during the call
- Tool call results - Outcomes from any tools or functions executed
- Assistant context - System prompts and configuration used during the call
Why use structured outputs?
Beyond simple data extraction:
- Call evaluation - Determine if objectives were met (appointment booked, issue resolved)
- Sentiment analysis - Understand customer satisfaction and emotional state
- CSAT scoring - Extract customer satisfaction scores from feedback
- Intelligent summaries - Generate contextual summaries of complex conversations
- Success metrics - Evaluate agent performance and call outcomes
Operational benefits:
- Automate data entry - No more manual transcription or form filling
- Ensure consistency - Every call captures the same structured information
- Enable integrations - Automatically sync data to CRMs, ticketing systems, or databases
- Improve analytics - Structured data is easier to analyze and report on
What you’ll build
A customer support assistant that automatically extracts:
- Customer name and contact details
- Issue description and priority
- Requested follow-up actions
Prerequisites
Sign up at dashboard.vapi.ai
Get your API key from API Keys on sidebar
Step 1: Create your structured output
Define what information you want to extract using a JSON Schema. JSON Schema is a standard for describing data structures - learn more about JSON Schema here.
Dashboard
cURL
TypeScript (Server SDK)
Python (Server SDK)
In the API approach, you’ll need to save the returned id
to attach it to an assistant. In the Dashboard, you can attach it directly when creating the structured output.
Step 2: Create and test a call
Now test your structured output by making a call.
Prerequisites: You need an assistant already created with:
- The structured output from Step 1 attached in
artifactPlan.structuredOutputIds
- A model and voice configured
- System prompt appropriate for your use case
You can create an assistant via the Dashboard or API, then use its ID in the examples below.
Dashboard
TypeScript (Server SDK)
Python (Server SDK)
cURL
Start a test call
- Navigate to your assistant (from Assistants in the sidebar)
- Ensure your structured output is attached in the Artifact Plan section
- Click Talk to Assistant in the top right corner
- The assistant will start speaking
Have a conversation
Try saying: “Hi, my name is John Smith. My email is john@example.com. I’m having trouble logging into my account - it keeps showing an error message. This is pretty urgent for me.”
During the call, try saying something like: “Hi, my name is John Smith. My email is john@example.com. I’m having trouble logging into my account - it keeps showing an error message. This is pretty urgent for me.”
Step 3: Retrieve extracted data
After the call ends, retrieve the extracted information:
Dashboard
TypeScript (Server SDK)
Python (Server SDK)
cURL
How structured outputs appear in Call Logs
When you view a call in the Call Logs page, structured outputs are displayed in the following format:
Structure explanation:
- Root level: Contains output IDs (UUIDs) as keys
- name: The name of the structured output configuration
- result: The actual extracted data based on your schema
- For object schemas: Contains the nested structure with all extracted fields
- For boolean schemas: Contains
true
orfalse
- For string schemas: Contains the extracted text
- For number schemas: Contains the numeric value
If you have multiple structured outputs attached to an assistant, each will appear with its own UUID key in the structuredOutputs object.
Expected output
The extracted data (the result
field from the API response) will look like this:
When accessing via API, this data is nested inside the structured output object at call.artifact.structuredOutputs[outputId].result
. The Dashboard shows the complete structure including the output ID and name.
Next steps
Learn about different data types and validation options
Configure different AI models for extraction
See complex real-world extraction scenarios
Complete API documentation for structured outputs
Common patterns
Multiple extractions
You can attach multiple structured outputs to extract different types of data:
structuredOutputIds
are UUIDs returned when you create each structured output configuration.Example: Intelligent analysis with multiple outputs
Structured outputs can perform sophisticated analysis beyond simple data extraction. Here’s a real example showing various types of intelligent evaluation:
This example demonstrates intelligent extraction capabilities:
- Call outcome evaluation:
Appointment Booked
(true) - Analyzed if the call’s objective was achieved - Data verification:
informationOnFileIsCorrect
(false) - Evaluated if customer data needed updates - Success metrics:
Success Evaluation - Pass/Fail
(true) - Determined overall call success based on multiple criteria - CSAT extraction:
CSAT
(8) - Extracted satisfaction score from customer feedback - Intelligent summarization:
Call Summary
- Generated contextual summary of the conversation - Process tracking:
Appointment Rescheduled
(false) - Tracked specific actions taken during the call
Each output analyzes the complete call context including transcript, tool results, and metadata to provide actionable insights.
Validation patterns
Common validation patterns for reliable extraction:
Tips for success
Best practices for reliable extraction:
- Start with required fields only for critical data
- Use enums for categorical data to ensure consistency
- Add descriptions to help the AI understand context
- Test with real conversations before production use
- Monitor extraction success rates and iterate on schemas
Troubleshooting
Get help
Need assistance? We’re here to help: