Create a new metric definition. The calculationType field selects the variant: LLM_JUDGE (LLM-evaluated), FORMULA (computed from a math expression over other metrics), or PATTERN (detects a trigger→outcome pattern within a window). To create a threshold on top of an existing metric, use POST /metric/definitions/{idOrSlug}/thresholds instead.
Documentation Index
Fetch the complete documentation index at: https://docs.roark.ai/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Input for creating a new metric definition. calculationType selects the variant and defaults to LLM_JUDGE when omitted (legacy prompt-metric payloads remain valid). To create a threshold, use the threshold sub-resource.
LLM-evaluated metric.
"LLM_JUDGE"Name of the metric
1 - 100"Customer Satisfaction"
Type of value this metric produces
COUNT, NUMERIC, BOOLEAN, SCALE, TEXT, CLASSIFICATION, OFFSET "BOOLEAN"
ID of the analysis package to add this metric to
Stable slug for the metric. Auto-generated from name if omitted.
1 - 50"customer_satisfaction"
Whether metric is global or per-participant (default: GLOBAL)
GLOBAL, PER_PARTICIPANT Participant role to evaluate. Required when scope is PER_PARTICIPANT.
AGENT, CUSTOMER, SIMULATED_CUSTOMER, BACKGROUND_SPEAKER Which levels this metric can produce values at (default: ["CALL"])
1CALL, SEGMENT, TURN LLM prompt/criteria for evaluating this metric. Required for BOOLEAN, NUMERIC, TEXT, and SCALE types.
2000"Evaluate whether the customer expressed satisfaction with the service provided."
Label for the true case (only for BOOLEAN type)
Label for the false case (only for BOOLEAN type)
Minimum value for scale. Required for SCALE type.
0 <= x <= 100Maximum value for scale. Required for SCALE type.
0 <= x <= 100Labels for scale ranges (only for SCALE type)
Options for classification. Required for CLASSIFICATION type.
1Maximum number of classifications that can be selected (only for CLASSIFICATION type)
x >= 1The created metric definition
Metric definition data