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

# Replay evaluations onto a new test case revision

> Re-runs the evaluations that any revision in `testCaseGroupId` was scored with against the new test case revision `newTestCaseId`, scoped to the given products. Because an evaluation is bound to a test case only through its session, fresh inference is generated for the new revision on each version that previously ran the family (production sessions excluded), then evaluated with the metrics that ran there. De-duplication skips a `(version, metric)` pair once it has a non-deleted evaluation against `newTestCaseId`, and skips a whole version once any non-deleted session exists for `newTestCaseId` — the session is created before this call returns, so a repeated or retried call re-dispatches nothing. This is still not a transactional guarantee for truly simultaneous calls. `newTestCaseId` must be the active head of its family.



## OpenAPI

````yaml https://api.galtea.ai/openapi.json post /evaluations/fromTestCases
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /evaluations/fromTestCases:
    post:
      tags:
        - evaluations
      summary: Replay evaluations onto a new test case revision
      description: >-
        Re-runs the evaluations that any revision in `testCaseGroupId` was
        scored with against the new test case revision `newTestCaseId`, scoped
        to the given products. Because an evaluation is bound to a test case
        only through its session, fresh inference is generated for the new
        revision on each version that previously ran the family (production
        sessions excluded), then evaluated with the metrics that ran there.
        De-duplication skips a `(version, metric)` pair once it has a
        non-deleted evaluation against `newTestCaseId`, and skips a whole
        version once any non-deleted session exists for `newTestCaseId` — the
        session is created before this call returns, so a repeated or retried
        call re-dispatches nothing. This is still not a transactional guarantee
        for truly simultaneous calls. `newTestCaseId` must be the active head of
        its family.
      operationId: evaluateFromTestCases
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFromTestCasesBody'
      responses:
        '202':
          description: Replay job accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplayFromTestCasesResult'
        '400':
          description: >-
            Invalid body, testCaseGroupId mismatch, or non-active revision
            target
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Test case or product not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateFromTestCasesBody:
      type: object
      properties:
        newTestCaseId:
          type: string
          minLength: 1
          example: testCase_123
          description: >-
            The new test case revision to replay onto. Must be the active head
            of its family.
        testCaseGroupId:
          type: string
          minLength: 1
          example: group_123
          description: >-
            The revision family whose past evaluations are replayed. Must match
            the test case.
        productIds:
          type: array
          items:
            type: string
            minLength: 1
          minItems: 1
          example:
            - prod_1
            - prod_2
          description: Products whose past evaluations are replayed.
      required:
        - newTestCaseId
        - testCaseGroupId
        - productIds
    ReplayFromTestCasesResult:
      type: object
      properties:
        scheduled:
          type: integer
          description: Count of (version, metric) pairs dispatched for fresh inference
        skipped:
          type: integer
          description: Count of (version, metric) pairs skipped (dispatch failures)
        errors:
          type: array
          items:
            type: string
          description: Per-version dispatch error messages
      required:
        - scheduled
        - skipped
        - errors
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````