> ## 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.

# Reevaluate Calls

> Re-run metric evaluation on a call log



## OpenAPI

````yaml post /observability/v1/call-logs/rerun_evaluation/
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:
  /observability/v1/call-logs/rerun_evaluation/:
    post:
      tags:
        - observability
      summary: Re-run metric evaluation on call logs
      description: >-
        Trigger metric re-evaluation on one or more existing call logs. Provide
        either `agent_id` or `assistant_id` (not both) to identify the agent,
        then specify which call logs to re-evaluate.


        **`call_logs` accepts:**

        - A list of call log IDs: `[1, 2, 3]`

        - The string `"all"` to re-evaluate every call log for the agent


        **Side effect:** for non-reviewed call logs, `success` is reset to
        `null` before re-evaluation begins. Reviewed call logs retain their
        human-approved outcome.


        **Rate limited.** If the limit is exceeded you will receive a 429
        response — wait for the `Retry-After` duration before retrying.
      operationId: call-logs-rerun-evaluation-create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RerunEvaluation'
            examples:
              Re-evaluate-specific-call-logs:
                value:
                  agent_id: 2142
                  call_logs:
                    - 101
                    - 102
                    - 103
                summary: re-evaluate-specific-call-logs
              Re-evaluate-all-call-logs:
                value:
                  agent_id: 2142
                  call_logs: all
                summary: re-evaluate-all-call-logs
              Re-evaluate-using-assistant-id:
                value:
                  assistant_id: 2143
                  call_logs:
                    - 101
                    - 102
                summary: re-evaluate-using-assistant-id
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RerunEvaluation'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RerunEvaluation'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CallLogDetail'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  field_name:
                    type: array
                    items:
                      type: string
          description: ''
      security:
        - api_key: []
components:
  schemas:
    RerunEvaluation:
      type: object
      properties:
        agent_id:
          type: integer
          description: >-
            Cekura agent ID. Provide this or `assistant_id`, not both. Example:
            `2142`
        assistant_id:
          type: integer
          description: >-
            External assistant identifier. Provide this or `agent_id`, not both.
            Example: `2143`
        call_logs:
          type: array
          items:
            type: integer
          description: >-
            List of call log IDs to re-evaluate, or the string `"all"` for all
            call logs. Example: `[1, 2, 3]`
      required:
        - agent_id
        - assistant_id
        - call_logs
    CallLogDetail:
      type: object
      description: ''
      properties:
        id:
          type: integer
          readOnly: true
        duration:
          type: string
          readOnly: true
          description: |-
            Call duration in minutes in MM:SS format.
            Example: `01:10`
        voice_recording_url:
          type: string
          readOnly: true
          description: >-
            URL to access the voice recording.

            Example:
            `"https://storage.example.com/recordings/call_123_20240315.mp3"`
        critical_categories:
          type: array
          items:
            $ref: '#/components/schemas/CallLogCriticalCategories'
          readOnly: true
          description: Critical categories from call evaluation
        transcript_object:
          type: array
          items:
            $ref: '#/components/schemas/CallLogTranscriptObject'
          readOnly: true
          description: |-
            Structured transcript data with timestamps.
            Example: 
            ```json
            [
                {
                    "role": "Testing Agent",
                    "content": "Hello",
                    "start_time": 1.2,
                    "end_time": 1.8
                },
                {
                    "role": "Main Agent",
                    "content": "Hello, how can I help you today?",
                    "start_time": 1.8,
                    "end_time": 2.5
                }
            ]`
        status:
          enum:
            - success
            - failure
            - reviewed_success
            - reviewed_failure
          type: string
          description: |-
            * `success` - Success
            * `failure` - Failure
            * `reviewed_success` - Reviewed Success
            * `reviewed_failure` - Reviewed Failure
          x-spec-enum-id: a5dfbbcee6f2a6ce
        agent_id:
          type: string
          description: |-
            Agent ID.
            Example: `2142`
        agent_name:
          type: string
          readOnly: true
          description: Agent name
        evaluation:
          allOf:
            - $ref: '#/components/schemas/Evaluation'
          readOnly: true
          description: |-
            Evaluation results for the call.
            Example: 
            ```json
            {
                "metrics": [
                    {
                        "id": 35,
                        "name": "Instruction Follow",
                        "type": "binary_workflow_adherence",
                        "score": 0,
                        "explanation": ["Agent failed to follow the opening script", "Missed key product information"],
                        "vocera_defined_metric_code": "5dedc41b",
                        "function_name": "check_critical_deviations",
                        "extra": {
                            "categories": [
                                {
                                    "category_id": 5,
                                    "category": "Script Adherence Issue",
                                    "deviation": "Agent deviated from required script",
                                    "priority": "critical"
                                }
                            ]
                        }
                    },
                    {
                        "id": 18,
                        "name": "Customer Satisfaction",
                        "type": "binary_qualitative",
                        "score": 5,
                        "explanation": ["Customer expressed satisfaction with service"]
                    }
                ]
            }
            ```
        metadata:
          type: object
          additionalProperties: {}
          readOnly: true
          description: |-
            Additional call metadata.
            Example: 
            ```json
            {
                "ended_reason": "customer-ended-call",
                "ringing_duration": 3.941,
                "call_type": "inbound"
            }
            ```
        dynamic_variables:
          type: object
          additionalProperties: {}
          readOnly: true
          description: |-
            Dynamic Variables used in the call.
            Example: 
            ```json
            {
                "customer_name": "John Doe",
                "order_id": "ORD-12345",
                "product_type": "premium"
            }
            ```
        testing_channel_index:
          type:
            - integer
            - 'null'
          readOnly: true
          description: The channel index of the testing agent in the audio recording
        timestamp:
          type: string
          format: date-time
          description: |-
            When the call occurred.
            Example: `2024-03-15T10:15:45Z`
        success:
          type:
            - boolean
            - 'null'
          description: |-
            Whether the call was successful.
            Example: `true` or `false`
        is_reviewed:
          type: boolean
          description: |-
            Whether the call has been reviewed.
            Example: `true` or `false`
        feedback:
          type: string
          description: |-
            Feedback about the call.
            Example: `"Great Call"`
        rubric:
          oneOf:
            - {}
            - type: 'null'
          description: |

            Detailed rubric evaluation data
            Example:
            ```json
            [
                {
                    "metric_id": 100,
                    "metric_name": "Call Quality",
                    "value": 5,
                    "explanation": ["The response was accurate"],
                    "passed": true,
                    "conditions": "score gte 5",
                    "expected_conditions": {"operator": "and", "conditions": [{"field": "score", "op": "gte", "value": 5}]}
                }
            ]
            ```
        transcript:
          type: string
          description: >
            Full text transcript of the call.

            Example: 

            ```text

            [00:01] Testing Agent: Hello. 

            [00:02] Main Agent: Hello, how can I help you today?

            [00:03] Testing Agent: Well, I mean, sure. What time exactly are we
            talking about here

            [00:04] Main Agent: 6 PM.

            [00:05] Testing Agent: Great. I'll book that for you. Just a sec.

            [00:06] Main Agent: Okay.

            ```
        call_ended_reason:
          type: string
          description: |
            Reason why the call ended.
            Example: 
            - `"customer-ended-call"`
            - `"agent-ended-call"`
          maxLength: 100
        dropoff_point:
          type: string
          description: |-
            Point in conversation where user disengaged.
            Example: `"end of conversation as no queries remaining"`
          maxLength: 1000
        topic:
          type: string
          description: |
            Topic of the call.
            Example: 
            - `"product_inquiry"`
            - `"technical_support"`
          maxLength: 1000
        customer_number:
          type: string
          description: |
            Customer's phone number or identifier.
            Example: 
            - `"+1234567890"`
            - `"customer_abc123"`
          maxLength: 100
        user_generated_transcript:
          oneOf:
            - {}
            - type: 'null'
          description: |-
            Manually created or corrected transcript data.
            Example: 
            ```json
            [
                {
                    "role": "Testing Agent",
                    "content": "I need help with my order",
                    "timestamp": "00:15"
                }
            ]`
        error_message:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: |-
            When this record was created.
            Example: `2024-03-15T10:30:45Z`
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: |-
            When this record was last updated.
            Example: `2024-03-15T10:35:11Z`
        call_id:
          type: string
          description: |-
            Unique identifier for the call.
            Example: 
            - `"call_abc123xyz"`
            - `"stereo_audio_session_456"`
          maxLength: 100
        trace_id:
          type: string
          description: >-
            OpenTelemetry trace ID (32-char hex). Set when OTel tracing is
            enabled.
          maxLength: 32
        agent:
          type:
            - integer
            - 'null'
          description: Agent ID
        project:
          type:
            - integer
            - 'null'
          description: Project ID (denormalized from agent for query performance)
      required:
        - call_id
    CallLogCriticalCategories:
      type: object
      properties:
        category_id:
          type: integer
          description: Category ID
        category:
          type: string
          description: Category name
        deviation:
          type: number
          format: double
          description: Deviation
        wrongly_marked:
          type: boolean
          description: Whether the category was wrongly marked
        feedback:
          type: string
          description: Feedback
        priority:
          enum:
            - critical
            - non-critical
            - not_a_bug
          type: string
          x-spec-enum-id: 6b5f38576e0a1903
          description: |-
            Priority

            * `critical` - Critical
            * `non-critical` - Non Critical
            * `not_a_bug` - Not A Bug
      required:
        - category
        - category_id
        - deviation
        - feedback
        - priority
        - wrongly_marked
    CallLogTranscriptObject:
      type: object
      properties:
        role:
          type: string
          description: Role of the message
        content:
          type: string
          description: Content of the message
        timestamp:
          type: number
          format: double
          description: Timestamp of the message
      required:
        - content
        - role
        - timestamp
    Evaluation:
      type: object
      properties:
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/CallLogListSerializerMetricsWithExplanation'
      required:
        - metrics
    CallLogListSerializerMetricsWithExplanation:
      type: object
      properties:
        id:
          type: integer
          description: Metric ID
        name:
          type: string
          description: Metric name
        type:
          type: string
          description: Metric type
        score:
          type: number
          format: double
          description: Evaluated metric score, Present if metrictype is not enum
        enum:
          type: string
          description: Metric enum, Present if type is enum
        value:
          type: string
          description: Evaluated metric value, Present if metric type is enum
        explanation:
          type: array
          items:
            type: string
            description: Explanation of the metric
        extra:
          type: object
          additionalProperties: {}
          description: Evaluated metric extra data
      required:
        - enum
        - explanation
        - extra
        - id
        - name
        - score
        - type
        - value
  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.

````