Compute a weighted supervisor scorecard
Compute per-agent supervisor scorecards from a REQUEST-supplied KPI definition: 1-10 KPI lines each picking a metric from the closed registry (QA score, handle time, calls answered, queue service level, CSAT, first-contact resolution), a direction, a target + guardband, and a weight. Each KPI line is normalized to a 0-100 attainment (goal met → 100 → progress → 0..100) and the composite is the weight-sum of the covered lines. Weights may be percentages or fractions — they normalise per request. Window is a named period (day|week|month) or an explicit from/to ISO pair; restrict to a team with queue_id or an explicit agent_ids allow-list. Supervisors are limited to their mapped queues. Reviewer scope (owner / admin / supervisor).
Authorizations
Dashboard JWT token from Clerk
Headers
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
1 - 255Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.
true, false Response
Per-agent supervisor scorecards for the resolved window and scope, plus the closed KPI registry the scorecard definitions reference. results is empty when no agent in scope has a roster row.