Skip to main content
PATCH

Authorizations

X-API-Key
string
header
required

API key for authentication

Headers

X-Coval-Workspace-Id
string

Workspace that scopes this operation. When omitted, the organization's active default workspace is used when one can be resolved.

Required string length: 1 - 26

Path Parameters

metric_id
string
required

22-character metric ID

Pattern: ^[a-zA-Z0-9]{22}$

Body

application/json

Update metric request (partial update)

metric_name
string
Required string length: 1 - 200
description
string
Required string length: 1 - 1000
metric_type
enum<string>

Metric evaluation type.

  • METRIC_AGENT_JUDGE - Agentic binary evaluation with bounded evidence tools
  • METRIC_AGENT_JUDGE_CATEGORICAL - Agentic categorical evaluation with bounded evidence tools
  • METRIC_AGENT_JUDGE_NUMERICAL - Agentic numerical evaluation with bounded evidence tools
  • METRIC_LLM_BINARY - Yes/no LLM evaluation
  • METRIC_CATEGORICAL - Multi-class classification
  • METRIC_NUMERICAL_LLM_JUDGE - Numerical scoring (1-N)
  • METRIC_AUDIO_LLM_BINARY - Audio-based yes/no
  • METRIC_AUDIO_LLM_CATEGORICAL - Audio-based classification
  • METRIC_AUDIO_LLM_NUMERICAL - Audio-based scoring
  • METRIC_TOOLCALL - Tool/function call evaluation
  • METRIC_METADATA_FIELD - Extract metadata field
  • METRIC_TRANSCRIPT_REGEX - Regex pattern matching
  • METRIC_PAUSE_ANALYSIS - Speech pause detection
  • METRIC_SQL_FLOAT - Custom SQL query over the simulation's data (set sql_query)
  • METRIC_COMPOSITE_EVALUATION - Judges a list of criteria independently and reports how many were met (set criteria_source, and criteria_path or criteria to match)
Available options:
METRIC_LLM_BINARY,
METRIC_AGENT_JUDGE,
METRIC_AGENT_JUDGE_CATEGORICAL,
METRIC_CATEGORICAL,
METRIC_AUDIO_LLM_BINARY,
METRIC_AUDIO_LLM_CATEGORICAL,
METRIC_TOOLCALL,
METRIC_METADATA_FIELD,
METRIC_AGENT_JUDGE_NUMERICAL,
METRIC_NUMERICAL_LLM_JUDGE,
METRIC_AUDIO_LLM_NUMERICAL,
METRIC_TRANSCRIPT_REGEX,
METRIC_USER_FRUSTRATION,
METRIC_AGENT_REFUSAL,
METRIC_PAUSE_ANALYSIS,
METRIC_SQL_FLOAT,
METRIC_COMPOSITE_EVALUATION,
METRIC_LLM_TTFB,
METRIC_TTS_TTFB,
METRIC_STT_TTFB,
METRIC_LLM_TOKEN_USAGE,
METRIC_TOOL_CALL_RATE,
METRIC_TRACE_STT_WER,
METRIC_TRACE_AUDIO_UPLOAD_STT_WER,
METRIC_CUSTOM_TRACE,
METRIC_VOICE_QUALITY,
METRIC_PHONEME_STRETCH,
METRIC_SYLLABLE_RATE,
METRIC_LOOP_DETECTION,
METRIC_CODEC_ARTIFACT,
METRIC_CLIPPING_ARTIFACT,
METRIC_DROPOUT_ARTIFACT,
METRIC_TIMBRE_DRIFT,
METRIC_SPEECH_ARTIFACT_ANOMALY,
METRIC_PITCH_VARIABILITY,
METRIC_NON_EXPRESSIVE_PAUSES,
METRIC_ABRUPT_PITCH_CHANGES,
METRIC_TERMINAL_CONTOUR,
METRIC_LUFS,
METRIC_VOLUME,
METRIC_VOCAL_FRY,
METRIC_DERIVED_STRICT_LOGIC,
METRIC_DERIVED_AGGREGATE,
METRIC_IVR_FLOW_ADHERENCE,
METRIC_CUSTOM_AGENT_FAILS_TO_RESPOND,
METRIC_CUSTOM_AGENT_NEEDS_REPROMPTING,
METRIC_CUSTOM_AUDIO_FREQUENCY,
METRIC_CUSTOM_AUDIO_SENTIMENT,
METRIC_CUSTOM_END_REASON,
METRIC_MATCH_EXPECTED_OUTPUT,
METRIC_SPEAKING_TIME_PERCENTAGE,
METRIC_SPECTROGRAM_PITCH_ANALYSIS,
METRIC_VOLUME_PITCH_MISALIGNMENT,
METRIC_WORDS_PER_MESSAGE_WITH_THRESHOLD
judge_mode
enum<string> | null

LLM Judge execution mode. Omit to preserve the existing mode.

Available options:
STANDARD,
AGENTIC
prompt
string
enabled_tools
enum<string>[] | null

Agentic LLM Judge tools. Omit to preserve the current/default selection; pass [] to disable all tools.

Evidence tool available to an Agent Judge metric.

Available options:
get_transcript,
search_transcript,
search_transcript_regex,
get_trace_spans,
query_simulation_frames,
get_run_context,
get_evidence_manifest,
get_simulation_outcome,
get_dependency_metric_outputs
dependency_metric_ids
string[] | null

Agent Judge metric dependencies. Omit to preserve the saved value; pass [] to clear dependencies.

Maximum array length: 10
Minimum string length: 1
categories
string[]
Required array length: 2 - 50 elements
min_value
number
max_value
number
metadata_field_type
enum<string>

Data type for metadata field extraction

Available options:
STRING,
NUMBER,
BOOLEAN
metadata_field_key
string
regex_pattern
string
role
enum<string>
Available options:
agent,
persona,
user,
assistant
min_pause_duration_seconds
number
Required range: x >= 0.5
max_silence_duration_seconds
number
Required range: x > 0
min_silence_gap_seconds
number
Required range: x > 0
frequency_threshold
number
Required range: x > 0
direction
enum<string>
Available options:
above,
below
success_sentiments
enum<string>[]
Minimum array length: 1
Available options:
Neutral,
Happy,
Angry,
Sad
percent_above
number
Required range: 0 <= x <= 100
success_end_reasons
enum<string>[]
Minimum array length: 1
Available options:
UNKNOWN,
IDLE_TIMEOUT,
DURATION_LIMIT,
PERSONA_DISCONNECTED,
AGENT_DISCONNECTED,
PIPELINE_ERROR,
REPETITION_LOOP,
AUDIO_UPLOAD_PLAYBACK_COMPLETED,
SCRIPT_COMPLETED,
SCRIPT_DIVERGED
observation_name
string
Minimum string length: 1
expected_body
Minimum string length: 1
match_path
string

Optional dot path; brackets must contain an integer index or comma-separated key=value filters.

Minimum string length: 1
min_volume_change_for_pitch_misalignment
number
Required range: x > 0
threshold
integer
Required range: x >= 0
operator
enum<string>
Available options:
<,
<=,
>,
>=,
==,
!=
ivr_flow
object

IVR flow definition (for METRIC_IVR_FLOW_ADHERENCE). Explicit null clears it.

Example:
sql_query
string

SQL query that defines the metric (for METRIC_SQL_FLOAT). SQL unit values must use supported result-unit identifiers such as s, ms, or count. An omitted unit preserves the current value; null or an empty string clears it.

Maximum string length: 50000
aggregation_method
string | null

Aggregation method for custom trace values, or SUM, AVERAGE, MIN, MAX, or COUNT for METRIC_SQL_FLOAT. Omit to preserve the current method; null resets a SQL metric to AVERAGE.

unit
string | null

Optional display unit. For METRIC_SQL_FLOAT, use a result-unit identifier such as s, ms, count, or percent. Omit to preserve the current unit; null or an empty string clears it.

Maximum string length: 32
criteria_source
enum<string>

Where a METRIC_COMPOSITE_EVALUATION metric reads its criteria from.

Available options:
test_case,
test_case_attribute,
metric_metadata
criteria_path
string

Path to the criteria on the source, when criteria_source is test_case or test_case_attribute.

Maximum string length: 200
criteria
string[]

Literal list of criteria, when criteria_source is metric_metadata.

reporting_method
enum<string>

How per-criterion verdicts aggregate into the metric's value.

Available options:
percentage_of_criteria_met,
count_of_criteria_met,
all_criteria_met
base_prompt_template
string

Custom prompt template used to evaluate each criterion.

Maximum string length: 50000
include_traces
boolean | null

Inject OTel trace context into the LLM judge prompt during evaluation. Supported for LLM judge metric types and METRIC_COMPOSITE_EVALUATION.

audio_filter
object | null

Omit to keep the current filter. null removes it so the metric analyzes its default scope. Any other value replaces the current filter. Supported for METRIC_ABRUPT_PITCH_CHANGES, METRIC_AUDIO_LLM_BINARY, METRIC_AUDIO_LLM_CATEGORICAL, METRIC_AUDIO_LLM_NUMERICAL, METRIC_CLIPPING_ARTIFACT, METRIC_CODEC_ARTIFACT, METRIC_CUSTOM_AGENT_NEEDS_REPROMPTING, METRIC_CUSTOM_AUDIO_FREQUENCY, METRIC_CUSTOM_AUDIO_SENTIMENT, METRIC_DROPOUT_ARTIFACT, METRIC_LOOP_DETECTION, METRIC_LUFS, METRIC_NON_EXPRESSIVE_PAUSES, METRIC_PAUSE_ANALYSIS, METRIC_PHONEME_STRETCH, METRIC_PITCH_VARIABILITY, METRIC_SPEAKING_TIME_PERCENTAGE, METRIC_SPECTROGRAM_PITCH_ANALYSIS, METRIC_SPEECH_ARTIFACT_ANOMALY, METRIC_SYLLABLE_RATE, METRIC_TERMINAL_CONTOUR, METRIC_TIMBRE_DRIFT, METRIC_VOCAL_FRY, METRIC_VOICE_QUALITY, METRIC_VOLUME, METRIC_VOLUME_PITCH_MISALIGNMENT; rejected with 400 for any other type. Changing metric_type to an unsupported type removes the filter.

Example:
runtime_config
object | null

Override the LLM model used for metric evaluation. Set to null to revert to the platform default. Use GET /v1/models/metric to list available models. Not supported for audio metric types (METRIC_AUDIO_LLM_BINARY, METRIC_AUDIO_LLM_CATEGORICAL, METRIC_AUDIO_LLM_NUMERICAL), which always use the platform-default audio model.

target_condition
object

Target condition for metric evaluation

Example:
tags
string[] | null

Tags to associate with this metric. Null or omitted leaves tags unchanged. Pass [] to clear all tags.

Example:
case_insensitive
boolean | null

Apply case-insensitive matching

detection_preset
enum<string> | null

METRIC_ABRUPT_PITCH_CHANGES / METRIC_NON_EXPRESSIVE_PAUSES / METRIC_VOCAL_FRY preset: 'strict', 'normal', or 'lenient'.

Available options:
strict,
normal,
lenient
harmonics_to_noise_ratio_threshold_offset_db
number | null

Advanced (dB): offset below baseline HNR under which a frame is fry (less negative flags more).

Required range: -25 <= x < 0
jitter_threshold_multiplier
number | null

Advanced: multiple of baseline jitter above which a frame is fry (lower flags more).

Required range: x > 1
loud_threshold_db
number | null

Advanced (dBFS): level at/above which audio is flagged loud. Must exceed soft_threshold_db.

Required range: -60 <= x <= 0
low_pitch_threshold_multiplier
number | null

Advanced: pitch fraction of baseline below which a frame is fry (higher flags more).

Required range: 0 < x < 1
mad_z_score_threshold
number | null

Advanced: override the preset's MAD modified z-score threshold.

Required range: x > 0
match_mode
enum<string> | null

Match mode: 'presence' or 'absence'

Available options:
presence,
absence
metric_attribute
string | null

Span attribute key to measure

Maximum string length: 200
metric_metadata
object | null

Derived metric config (replaces existing config on update)

min_fry_segment_seconds
number | null

Advanced (s): minimum kept fry-run duration (lower flags more).

Required range: 0 <= x <= 1
pause_detection_preset
enum<string> | null

Anomaly detection preset (recommended). 'strict' / 'normal' / 'lenient' control MAD threshold and minimum pause count. Most callers should set this instead of the fields below.

Available options:
strict,
normal,
lenient
pitch_change_threshold_hz
number | null

Advanced (Hz): pitch movement near a pause above which the pause counts as expressive.

Required range: x > 0
position
enum<string> | null

Position constraint: 'any', 'first', or 'last'

Available options:
any,
first,
last
significant_changes_threshold_hz
number | null

Advanced (Hz): pitch jump above which a change counts as abrupt (lower flags more).

Required range: x > 0
soft_threshold_db
number | null

Advanced (dBFS): level at/below which audio is flagged soft.

Required range: -60 <= x <= 0
span_name
string | null

OTel span name to query

Maximum string length: 200
threshold_preset
enum<string> | null

METRIC_VOLUME threshold preset: 'strict', 'normal', or 'lenient'.

Available options:
strict,
normal,
lenient
value_source
string | null

Source of the aggregated value for METRIC_CUSTOM_TRACE: 'attribute' reads the configured span attribute; 'duration' aggregates the span's own duration in seconds. None leaves it unchanged.

Response

Metric updated

metric
object
required

Metric resource