> ## 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 metric revision

> Re-runs historical evaluations that used any metric in `metricGroupId` against the new metric revision `newMetricId`, scoped to the given products. Idempotent: any `(sessionId, inferenceResultId)` pair that already has an evaluation on `newMetricId` is skipped.

> [!WARNING]
>
> You are reading the docs of Galtea 5.10. [Read this page in the latest version](https://docs.galtea.ai/api-reference/evaluations/replay-evaluations-onto-a-new-metric-revision.md).


## OpenAPI

````yaml /v5.10/openapi.json post /evaluations/fromMetrics
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/fromMetrics:
    post:
      tags:
        - evaluations
      summary: Replay evaluations onto a new metric revision
      description: >-
        Re-runs historical evaluations that used any metric in `metricGroupId`
        against the new metric revision `newMetricId`, scoped to the given
        products. Idempotent: any `(sessionId, inferenceResultId)` pair that
        already has an evaluation on `newMetricId` is skipped.
      operationId: evaluateFromMetrics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluateFromMetricsBody'
      responses:
        '202':
          description: Replay job accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvaluateFromMetricsResult'
        '400':
          description: Invalid body or metricGroupId does not match the metric
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Metric or product not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    EvaluateFromMetricsBody:
      type: object
      properties:
        newMetricId:
          type: string
          minLength: 1
          example: metric_123
        metricGroupId:
          type: string
          minLength: 1
          example: group_123
        productIds:
          type: array
          items:
            type: string
            minLength: 1
          example:
            - prod_1
            - prod_2
      required:
        - newMetricId
        - metricGroupId
        - productIds
    EvaluateFromMetricsResult:
      type: object
      properties:
        scheduled:
          type: integer
        skipped:
          type: integer
        errors:
          type: array
          items:
            type: string
        runIds:
          type: array
          items:
            type: string
          description: The runs this replay opened, one per product.
      required:
        - scheduled
        - skipped
        - errors
        - runIds
    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-...`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.