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

> Create a test set from test run data



## OpenAPI

````yaml post /test_framework/test-sets/create_from_run/
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_run/:
    post:
      tags:
        - test_framework
      summary: Create a test set from a previous test run
      description: >-
        Promote a completed test run into a labeled test set by attaching the
        specified metrics. Existing metric scores from the run are copied as the
        initial 'actual' values; the caller provides 'expected' values for
        review. Returns the created or existing test set.
      operationId: test-sets-create-from-run
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchemaPostCreateFromRunRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SchemaPostCreateFromRunRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SchemaPostCreateFromRunRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestSetDetail'
          description: ''
      security:
        - api_key: []
components:
  schemas:
    SchemaPostCreateFromRunRequest:
      type: object
      properties:
        run_id:
          type: integer
          description: ID of the run to create test set from
        project:
          type: integer
          description: ID of the project that owns the run
        name:
          type: string
          default: ''
          description: Optional name for the test set. If not provided, run 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:
        - metrics
        - run_id
    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.

````