v50

latestOpenAPI 3.1.0raw.githubusercontent.com2026-04-285553225.5 KB
Metric

Create a metric definition

Create a new custom metric definition. The metric will be added to the specified analysis package and can be used for evaluating calls.

post/v1/metric/definitions

Request body

namestring required

Name of the metric

metricIdstring

Unique identifier for the metric (e.g. "customer_satisfaction"). Auto-generated from name if not provided.

outputType'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET' required

Type of value this metric produces

scope'GLOBAL' | 'PER_PARTICIPANT'

Whether metric is global or per-participant (default: GLOBAL)

participantRole'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER'

Participant role to evaluate. Required when scope is PER_PARTICIPANT.

supportedContextsstring[]

Which levels this metric can produce values at (default: ["CALL"])

llmPromptstring

LLM prompt/criteria for evaluating this metric. Used to instruct the model on how to score. Required for BOOLEAN, NUMERIC, TEXT, and SCALE types.

analysisPackageIdstring uuid required

ID of the analysis package to add this metric to

booleanTrueLabelstring

Label for the true/positive case (only for BOOLEAN type)

booleanFalseLabelstring

Label for the false/negative case (only for BOOLEAN type)

scaleMininteger

Minimum value for scale. Required for SCALE type.

scaleMaxinteger

Maximum value for scale. Required for SCALE type.

maxClassificationsinteger

Maximum number of classifications that can be selected (only for CLASSIFICATION type)

Example request

{
  "name": "Customer Satisfaction",
  "metricId": "customer_satisfaction",
  "outputType": "BOOLEAN",
  "scope": "GLOBAL",
  "supportedContexts": [
    "CALL"
  ],
  "llmPrompt": "Evaluate whether the customer expressed satisfaction with the service provided.",
  "booleanTrueLabel": "Satisfied",
  "booleanFalseLabel": "Not Satisfied",
  "scaleMin": 1,
  "scaleMax": 5
}

Response

The created metric definition