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

# Create Test Set from Call Log

> Create a test set from call log data



## OpenAPI

````yaml post /test_framework/test-sets/create_from_call_log/
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/test-sets/create_from_call_log/:
    post:
      tags:
        - test_framework
      summary: Create a test set from a production call log
      description: >-
        Promote a real production call into a labeled test set by attaching the
        specified metrics. The call's transcript, recording, and any existing
        metric evaluations are copied into the new test set so they can be
        reviewed and used as labeled ground truth. Returns the created or
        existing test set.
      operationId: test-sets-create-from-call-log
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchemaPostCreateFromCallLogRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SchemaPostCreateFromCallLogRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SchemaPostCreateFromCallLogRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestSetDetail'
          description: ''
      security:
        - api_key: []
components:
  schemas:
    SchemaPostCreateFromCallLogRequest:
      type: object
      properties:
        call_log_id:
          type: integer
          description: ID of the call log to create test set from
        project:
          type: integer
          description: ID of the project that owns the call log
        name:
          type: string
          default: ''
          description: >-
            Optional name for the test set. If not provided, call log ID will be
            used
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/MetricWithFeedback'
          description: List of metrics with optional notes to include in the test set
      required:
        - call_log_id
        - metrics
    TestSetDetail:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        agent:
          type: integer
        name:
          type: string
          description: |

            Name of the test set
            Example: `"Test Set 1"`
          maxLength: 255
        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.

            ```
        transcript_object:
          oneOf:
            - {}
            - type: 'null'
        voice_recording:
          type: string
          format: uri
          writeOnly: true
        voice_recording_url:
          type: string
          readOnly: true
          description: Audio URL
        call_end_reason:
          type: string
          description: |
            Reason why the call ended.
            Example: 
            - `"customer-ended-call"`
            - `"agent-ended-call"`
          maxLength: 255
        duration:
          type: string
          readOnly: true
          description: |-
            Call duration in minutes in MM:SS format.
            Example: `01:10`
        source_model:
          enum:
            - CallLog
            - Run
          type: string
          description: |-
            * `CallLog` - Call Log
            * `Run` - Run
          x-spec-enum-id: 1d8f6db20c0b4cac
          readOnly: true
        source_id:
          type: string
          readOnly: true
        metric_reviews:
          type: array
          items:
            $ref: '#/components/schemas/MetricReviewInline'
          readOnly: true
        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`
      required:
        - agent
        - voice_recording
    MetricWithFeedback:
      type: object
      properties:
        metric:
          type: integer
          description: ID of the metric
        feedback:
          type: string
          default: ''
          description: Optional note/feedback for the metric
        expected_value:
          oneOf:
            - {}
            - type: 'null'
          description: Optional expected value for the metric
      required:
        - metric
    MetricReviewInline:
      type: object
      properties:
        id:
          type: integer
        metric:
          type: integer
          readOnly: true
        metric_name:
          type: string
          readOnly: true
        metric_enum_values:
          readOnly: true
        eval_type:
          type: string
          readOnly: true
        expected_value:
          oneOf:
            - {}
            - type: 'null'
          description: |

            Metric expected value
            Example:
            - `5` or `0`
            - `one`, `two` or `three` [ enum type ]
        explanation:
          readOnly: true
          description: >

            Metric explanation

            Example:

            ```json

            ["Agent failed to follow the opening script", "Missed key product
            information"]

            ```
        feedback:
          type: string
          description: |

            Metric feedback
            Example:
            - `"Great Call"`
        metric_function_name:
          type: string
          readOnly: true
        metric_vocera_defined_metric_code:
          type: string
          readOnly: true
      required:
        - id
  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.

````