> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cekura.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Metric

> Partially update a metric. Same field shape as create — see `metrics_create` for details.



## OpenAPI

````yaml patch /test_framework/v1/metrics/{id}/
openapi: 3.1.0
info:
  title: Cekura API
  version: v1
  description: >-
    Complete API documentation for the Cekura platform. This API provides
    endpoints for testing, observing, and evaluating AI voice agents — including
    managing agents, running evaluators, defining metrics, and analyzing call
    quality.
servers:
  - url: https://api.cekura.ai
security: []
paths:
  /test_framework/v1/metrics/{id}/:
    patch:
      tags:
        - Metrics
      summary: Update a metric (partial)
      description: >-
        Partially update a metric. Same field shape as create — see
        `metrics_create` for details.


        **Note:** `project` and `agent` are read-only once set — you cannot move
        a metric between projects/agents after creation. To relocate, create a
        new metric and delete the old one.
      operationId: metrics-partial-update
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this metric.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSchemaPostMetricEdit'
            examples:
              UpdatePrompt+CriticalFlag:
                value:
                  description: Updated rubric
                  is_critical: true
                summary: Update prompt + critical flag
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSchemaPostMetricEdit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSchemaPostMetricEdit'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaPostMetricEdit'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  field_name:
                    type: array
                    items:
                      type: string
          description: ''
      security:
        - api_key: []
components:
  schemas:
    PatchedSchemaPostMetricEdit:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Name of the metric
        description:
          type: string
          description: Description of what this metric evaluates
        audio_enabled:
          type: boolean
          description: Whether this metric evaluates audio content
        prompt:
          type: string
          description: The evaluation prompt used for this metric
        project:
          type: integer
          description: ID of the project this metric belongs to.
        agents:
          type: array
          items:
            type: integer
          description: >-
            List of agent IDs to enable this project-level metric for. Only
            applicable when project is set.
        assistant_id:
          type: string
          description: External identifier for the assistant
        type:
          enum:
            - basic
            - custom_prompt
            - custom_code
            - llm_judge
          type: string
          x-spec-enum-id: b44700c0a6443b40
          description: >-
            Type of metric (`llm_judge` recommended; `basic` and `custom_prompt`
            are deprecated)


            * `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:
          enum:
            - binary_workflow_adherence
            - binary_qualitative
            - continuous_qualitative
            - numeric
            - enum
          type: string
          x-spec-enum-id: 1e3e27b342bfd8ec
          description: |-
            Output shape of the evaluation score

            * `binary_workflow_adherence` - Binary Workflow Adherence
            * `binary_qualitative` - Binary Qualitative
            * `continuous_qualitative` - Continuous Qualitative
            * `numeric` - Numeric
            * `enum` - Enum
        enum_values:
          type: array
          items:
            type: string
          description: >-
            Possible values for enum-type metrics (list of strings, e.g.
            ["resolved", "escalated", "abandoned"])
        display_order:
          type: integer
          description: Order in which to display this metric in the UI
        configuration:
          type: object
          additionalProperties: {}
          description: >-
            Per-metric configuration.


            Some predefined metrics carry **per-agent** configuration, keyed by
            agent id: `configuration[<key>] = {"<agent_id>": <value>}`. On read,
            every agent attached to the metric is returned; on write, only the
            agent ids you include are updated.


            Call-level keys (not per-agent):

            * **Detect Silence** — `silence_duration` (int, seconds, default
            10): minimum mutual silence before flagging a failure.

            * **Infrastructure Issues** — `infra_issues_timeout` (int, seconds,
            default 10): max seconds before the Main Agent must respond after
            the Testing Agent finishes speaking.


            Per-agent keys (each value is `{"<agent_id>": <value>}`):

            * **Dropoff Node** — `nodes`: `{"<agent_id>": [{name,
            description}]}` — conversation stages used to classify where a call
            dropped off.

            * **Topic of Call** — `nodes`: `{"<agent_id>": [{name,
            description}]}` — topic categories used to classify each call.

            * **Pronunciation Check** — `pronunciation_words`: `{"<agent_id>":
            [[word, phonemes], ...]}` — how specific words should be pronounced
            (e.g. {"42": [["Cekura", "suh-KYUR-uh"]]}).

            * **Letterwise Pronunciation** — `spelling_word_types`:
            `{"<agent_id>": ["name", "email", ...]}` — word categories the Main
            Agent must spell out letter-by-letter.

            * **Hallucination** — `hallucination_kb_files`: `{"<agent_id>":
            [file_id, ...]}` — KnowledgeBaseFile IDs used as the source of truth
            for fact-checking.
        add_to_new_agents:
          type:
            - boolean
            - 'null'
          description: >-
            When enabled, this metric is automatically assigned to new agents
            created in the project.
        simulation_enabled:
          type: boolean
          description: |-

            Enable this metric for simulations.
            Example: `true` or `false`
                    
        observability_enabled:
          type: boolean
          description: |-

            Enable this metric for observability.
            Example: `true` or `false`
                    
        sampling_enabled:
          type: boolean
          description: Enable sampling for this metric using project-level sample rate
        evaluation_trigger:
          enum:
            - always
            - automatic
            - custom
          type: string
          x-spec-enum-id: ecd3c02e0e393ef5
          default: always
          description: >-
            When to run this metric.


            * `always` — evaluate every call (default)

            * `automatic` — system decides based on call content

            * `custom` — only evaluate when `evaluation_trigger_prompt`
            condition is met


            * `always` - Always

            * `automatic` - Automatic

            * `custom` - Custom
        evaluation_trigger_prompt:
          type: string
          description: >-
            LLM prompt that decides whether to evaluate this call. Only used
            when `evaluation_trigger=custom` and `trigger_type=llm_judge`.

            Example: "Did the agent offer a refund?"
        trigger_type:
          enum:
            - llm_judge
            - custom_code
          type: string
          x-spec-enum-id: 2adad4b8df61914f
          default: llm_judge
          description: >-
            How to evaluate the trigger condition. Only relevant when
            `evaluation_trigger=custom`.


            * `llm_judge` — use `evaluation_trigger_prompt` (default)

            * `custom_code` — use `evaluation_trigger_custom_code`


            * `llm_judge` - LLM Judge

            * `custom_code` - Custom Code
        evaluation_trigger_custom_code:
          type: string
          description: >-
            Python code to evaluate the trigger condition. Only used when
            `evaluation_trigger=custom` and `trigger_type=custom_code`.
        custom_code:
          type: string
          description: >-
            Python code that implements the metric evaluation. Required when
            `type=custom_code`. Must define a function `evaluate(transcript,
            ...) -> bool | float | str`.
    SchemaPostMetricEdit:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Name of the metric
        description:
          type: string
          description: Description of what this metric evaluates
        audio_enabled:
          type: boolean
          description: Whether this metric evaluates audio content
        prompt:
          type: string
          description: The evaluation prompt used for this metric
        project:
          type: integer
          description: ID of the project this metric belongs to.
        agents:
          type: array
          items:
            type: integer
          description: >-
            List of agent IDs to enable this project-level metric for. Only
            applicable when project is set.
        assistant_id:
          type: string
          description: External identifier for the assistant
        type:
          enum:
            - basic
            - custom_prompt
            - custom_code
            - llm_judge
          type: string
          x-spec-enum-id: b44700c0a6443b40
          description: >-
            Type of metric (`llm_judge` recommended; `basic` and `custom_prompt`
            are deprecated)


            * `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:
          enum:
            - binary_workflow_adherence
            - binary_qualitative
            - continuous_qualitative
            - numeric
            - enum
          type: string
          x-spec-enum-id: 1e3e27b342bfd8ec
          description: |-
            Output shape of the evaluation score

            * `binary_workflow_adherence` - Binary Workflow Adherence
            * `binary_qualitative` - Binary Qualitative
            * `continuous_qualitative` - Continuous Qualitative
            * `numeric` - Numeric
            * `enum` - Enum
        enum_values:
          type: array
          items:
            type: string
          description: >-
            Possible values for enum-type metrics (list of strings, e.g.
            ["resolved", "escalated", "abandoned"])
        display_order:
          type: integer
          description: Order in which to display this metric in the UI
        configuration:
          type: object
          additionalProperties: {}
          description: >-
            Per-metric configuration.


            Some predefined metrics carry **per-agent** configuration, keyed by
            agent id: `configuration[<key>] = {"<agent_id>": <value>}`. On read,
            every agent attached to the metric is returned; on write, only the
            agent ids you include are updated.


            Call-level keys (not per-agent):

            * **Detect Silence** — `silence_duration` (int, seconds, default
            10): minimum mutual silence before flagging a failure.

            * **Infrastructure Issues** — `infra_issues_timeout` (int, seconds,
            default 10): max seconds before the Main Agent must respond after
            the Testing Agent finishes speaking.


            Per-agent keys (each value is `{"<agent_id>": <value>}`):

            * **Dropoff Node** — `nodes`: `{"<agent_id>": [{name,
            description}]}` — conversation stages used to classify where a call
            dropped off.

            * **Topic of Call** — `nodes`: `{"<agent_id>": [{name,
            description}]}` — topic categories used to classify each call.

            * **Pronunciation Check** — `pronunciation_words`: `{"<agent_id>":
            [[word, phonemes], ...]}` — how specific words should be pronounced
            (e.g. {"42": [["Cekura", "suh-KYUR-uh"]]}).

            * **Letterwise Pronunciation** — `spelling_word_types`:
            `{"<agent_id>": ["name", "email", ...]}` — word categories the Main
            Agent must spell out letter-by-letter.

            * **Hallucination** — `hallucination_kb_files`: `{"<agent_id>":
            [file_id, ...]}` — KnowledgeBaseFile IDs used as the source of truth
            for fact-checking.
        add_to_new_agents:
          type:
            - boolean
            - 'null'
          description: >-
            When enabled, this metric is automatically assigned to new agents
            created in the project.
        simulation_enabled:
          type: boolean
          description: |-

            Enable this metric for simulations.
            Example: `true` or `false`
                    
        observability_enabled:
          type: boolean
          description: |-

            Enable this metric for observability.
            Example: `true` or `false`
                    
        sampling_enabled:
          type: boolean
          description: Enable sampling for this metric using project-level sample rate
        evaluation_trigger:
          enum:
            - always
            - automatic
            - custom
          type: string
          x-spec-enum-id: ecd3c02e0e393ef5
          default: always
          description: >-
            When to run this metric.


            * `always` — evaluate every call (default)

            * `automatic` — system decides based on call content

            * `custom` — only evaluate when `evaluation_trigger_prompt`
            condition is met


            * `always` - Always

            * `automatic` - Automatic

            * `custom` - Custom
        evaluation_trigger_prompt:
          type: string
          description: >-
            LLM prompt that decides whether to evaluate this call. Only used
            when `evaluation_trigger=custom` and `trigger_type=llm_judge`.

            Example: "Did the agent offer a refund?"
        trigger_type:
          enum:
            - llm_judge
            - custom_code
          type: string
          x-spec-enum-id: 2adad4b8df61914f
          default: llm_judge
          description: >-
            How to evaluate the trigger condition. Only relevant when
            `evaluation_trigger=custom`.


            * `llm_judge` — use `evaluation_trigger_prompt` (default)

            * `custom_code` — use `evaluation_trigger_custom_code`


            * `llm_judge` - LLM Judge

            * `custom_code` - Custom Code
        evaluation_trigger_custom_code:
          type: string
          description: >-
            Python code to evaluate the trigger condition. Only used when
            `evaluation_trigger=custom` and `trigger_type=custom_code`.
        custom_code:
          type: string
          description: >-
            Python code that implements the metric evaluation. Required when
            `type=custom_code`. Must define a function `evaluate(transcript,
            ...) -> bool | float | str`.
      required:
        - assistant_id
        - audio_enabled
        - configuration
        - description
        - display_order
        - eval_type
        - name
        - project
        - prompt
        - type
  securitySchemes:
    api_key:
      type: apiKey
      name: X-CEKURA-API-KEY
      in: header
      description: >-
        API Key Authentication. It should be included in the header of each
        request.

````