Scorecard quickstart
Overview
This quickstart shows how to create a scorecard that automatically grades calls based on your structured outputs. You’ll create a scorecard, attach it to an assistant, run a call, and retrieve the score — using API only for now.
What are scorecards?
Scorecards compute objective quality metrics from the call’s structured outputs after the call ends:
- Evaluate against metrics - Compare structured output values to conditions you define
- Allocate points - Grant points when conditions are met, per metric
- Filter Calls - Filter calls based on the scorecard’s metrics
When are scorecards generated?
- After call completion
- Typically within seconds of call end
- Available in
call.artifact.scorecards
What data do scorecards use?
- Structured outputs attached to the assistant (
artifactPlan.structuredOutputIds) - Each metric references one structured output (must be number/integer or boolean)
Why use scorecards?
- Grade calls consistently and automatically providing a quick overview of the call’s quality
- Power dashboards and automated workflows with numeric scores
What you’ll build
A scorecard that:
- Awards points if the call objective was achieved (boolean structured output)
- Awards points if CSAT is above a threshold (number structured output)
- Filters calls based on the scorecard’s metrics
Prerequisites
You need: A Vapi account and API key, an assistant with a model and voice configured, structured outputs created and attached that your scorecard will use
Metrics can only reference structured outputs of type number/integer or boolean.
Step 1: Create a scorecard
Create a scorecard with metrics. Each metric references a structured output ID and one or more conditions.
Notes:
- Supported comparators:
=,!=,>,<,>=,<= - Boolean metrics support only
=operator - Points for all rules must sum to 100
- If you pass
assistantIds, the scorecard is linked to those assistants
Step 2: Optional - Attach to an assistant
Adding the assistantId to the scorecard will link the scorecard to the assistant, so that the scorecard is automatically applied to all calls made with the assistant. However, if the assistantId has not been set on the scorecard, you can still PATCH the assistant to add the scorecard.
If you included assistantIds when creating the scorecard, you can still
PATCH later to add more assistants.
Step 3: Create and test a call
Start a call with your assistant.
Step 4: Retrieve the score
Wait a few seconds after the call ends, then fetch the call:
Scorecards live at call.artifact.scorecards:
Expected output
- Root keys are scorecard IDs (UUIDs)
score: sum of awarded pointsscoreNormalized: ceil(score / maxPoints * 100)metricPoints: points awarded per structured output
Read extracted data values from call.artifact.structuredOutputs. Evaluation
results are under call.artifact.scorecards[scorecardId].
Next steps
- Attach multiple scorecards to the same assistant
- Add more metrics and conditions
- Track normalized score trends over time
Common patterns
Multiple scorecards
Transient scorecards (inline)
You can embed “inline” scorecards for rapid testing (no saved scorecard ID) using artifactPlan.scorecards:
Validation rules
- Referenced structured outputs must be type number/integer or boolean
- Number conditions accept:
=,!=,>,<,>=,<= - Boolean conditions accept:
=only - Points must be 0–100 per condition
Tips for success
- Keep metrics focused; use multiple conditions per metric to tier points
- Use normalized score for consistent reporting across different scorecards
- Ensure all referenced structured outputs are attached to the assistant