test_framework

Attach predefined metrics to a project

Changed on

Copy one or more predefined metrics (e.g. Voice Tone + Clarity, Latency, CSAT) into a project so they evaluate its calls. Pass project_id and either predefined_metric_ids or metric_codes from the predefined metrics list. Use this to add these built-in metrics — they cannot be created through the metrics create endpoint.

post/test_framework/v1/predefined-metrics/copy/

Request

  • Base URL
    https://api.cekura.ai
  • URL
    https://api.cekura.ai/test_framework/v1/predefined-metrics/copy/
  • Auth
    • API key in header X-CEKURA-API-KEY
    • or HTTP bearer
    • or HTTP bearer

Request body

predefined_metric_idsinteger[]

IDs of the predefined metrics to attach. Get these from the predefined metrics list.

metric_codesstring[]

Codes of the predefined metrics to attach. Provide this or predefined_metric_ids.

project_idinteger

Project to attach the metrics to. Provide either project_id or agent_id, not both.

agent_idinteger

Agent to attach the metrics to. Provide either project_id or agent_id, not both.

scenariosinteger[]

Optional scenario IDs to scope the metrics to (max 1000). Omit to apply across the target.

Response

idinteger
slugstring nullable

URL-friendly unique identifier in snake_case format. Example: "customer_satisfaction_1562"

projectinteger nullable
agentsinteger[]
agent_namesstring
namestring required

Name of the metric. Example: "Customer Satisfaction" or "Appointment Booking"

descriptionstring

Description of what the metric measures. Example: "Measures how satisfied customers are with the service provided"

function_namestring nullable

Predefined function name Example: "get_latency" or "check_critical_deviations"

type'basic' | 'custom_prompt' | 'custom_code' | 'llm_judge'

Type of metric

  • basic - Basic (Deprecated in favor of LLM Judge)
  • custom_prompt - Custom Prompt ( Deprecated in favor of LLM Judge)
  • custom_code - Custom Code
  • llm_judge - LLM Judge
eval_type'binary' | 'continuous_qualitative' | 'numeric' | 'enum' required
  • binary - Binary
  • continuous_qualitative - Continuous Qualitative
  • numeric - Numeric
  • enum - Enum
enum_valuesunknown
audio_enabledboolean

Whether this metric requires audio analysis. Example: true or false

observability_enabledboolean

Enable this metric for observability. Example: true or false

simulation_enabledboolean

Enable this metric for simulations. Example: true or false

sampling_enabledboolean

Enable sampling for this metric using its sample_rate, or the project sample rate when unset

sample_ratenumber double nullable

Sampling rate for this metric (0.0 to 1.0). Overrides the project sample rate when set.

promptstring

Evaluation prompt for the metric. Example: "Evaluate customer satisfaction based on conversation"

display_orderinteger

Display order for the metric. Example: 1

evaluation_trigger'always' | 'automatic' | 'custom'
  • always - Always
  • automatic - Automatic
  • custom - Custom
trigger_type'llm_judge' | 'custom_code'
  • llm_judge - LLM Judge
  • custom_code - Custom Code
evaluation_trigger_promptstring

Evaluation trigger prompt for the metric. Example: "Evaluate metric only if call ended reason is main-agent-ended-call"

evaluation_trigger_custom_codestring

Python custom code to determine metric relevance. Code should set _result (bool) and _explanation (str). Example:

_result = True
_explanation = "Metric is relevant"
if "call_end_reason" in data and data["call_end_reason"] == "customer-hung-up":
    _result = False
    _explanation = "Customer hung up, metric not applicable"
priority_assignment_promptstring

Priority assignment prompt for the metric.

vocera_defined_metric_codestring

Vocera defined metric code for the metric. Example: "7fd534f5"

configurationunknown
kb_file_idsinteger[]

List of knowledge base file IDs for the metric. Example: [123, 456]

scenariosunknown
custom_codestring
metric_costnumber double

Metric Cost Example: 0.10

alert_type'disabled' | 'normal' | 'significant_change'
  • disabled - Alerts Disabled
  • normal - Normal Alerts
  • significant_change - Significant Change Alerts
significant_change_alert_status'enabled' | 'disabled'

Alert status: enabled or disabled.

  • enabled - Enabled
  • disabled - Disabled
significant_change_alert_direction'' | 'increase' | 'decrease'

Alert direction: increase only, decrease only, or both (empty = both). Example: "increase", "decrease", or "both"

  • `` - Both (Increase and Decrease)
  • increase - Increase Only
  • decrease - Decrease Only
window_sizeinteger

Window size for rolling statistics calculation. Example: 50

std_multipliernumber double

Standard deviation multiplier for threshold calculation. Example: 2.0

ewma_alphanumber double

Alpha value for exponentially weighted moving average (EWMA) calculation. Example: 0.1

add_to_new_agentsboolean nullable

When enabled, this metric is automatically assigned to new agents created in the project.

alert_filtersunknown
slack_workspaceinteger nullable

Slack workspace to send alerts to

slack_channel_idstring nullable

Override channel ID for this metric's alerts

uses_llm_judgestring

Whether this metric produces an LLM-judge narrative: a custom_code metric whose code delegates to the LLM judge internally. Computed server-side because the custom_code body is write-only and not exposed on read. Example: true

Changes