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

# List metric versions

> List the prior-state version history for a metric, newest first. The live metric is the current version (see MetricResource.current_version) and is not included here. Built-in metrics carry no per-organization history and return an empty list.



## OpenAPI

````yaml /api-reference/v1/metrics-v1.yaml get /metrics/{metric_id}/versions
openapi: 3.0.3
info:
  title: Coval Metrics API
  version: 1.0.0
  description: |
    Manage custom evaluation metrics for agent testing and monitoring.
  contact:
    name: Coval API Support
    email: support@coval.dev
    url: https://docs.coval.ai
  license:
    name: Proprietary
    url: https://coval.dev/terms
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: Metrics
    description: CRUD operations for custom evaluation metrics
paths:
  /metrics/{metric_id}/versions:
    get:
      tags:
        - Metrics
      summary: List metric versions
      description: >-
        List the prior-state version history for a metric, newest first. The
        live metric is the current version (see MetricResource.current_version)
        and is not included here. Built-in metrics carry no per-organization
        history and return an empty list.
      operationId: listMetricVersions
      parameters:
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]{22}$
          description: 22-character metric ID
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListMetricVersionsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ListMetricVersionsResponse:
      type: object
      description: Response for GET /v1/metrics/{metric_id}/versions (newest first)
      required:
        - versions
      properties:
        versions:
          type: array
          items:
            $ref: '#/components/schemas/MetricVersionResource'
    MetricVersionResource:
      type: object
      description: A prior, displaced snapshot of a metric's scoring config.
      required:
        - name
        - ulid
        - version_number
        - change_type
        - metric_type
        - created_by
      properties:
        name:
          type: string
          description: Resource name
          example: metrics/abc123def456ghi789jklm/versions/01KKWQYSF737ZN6X1Q1RYX8M2D
        ulid:
          type: string
          description: Version identifier (26-char ULID)
          example: 01KKWQYSF737ZN6X1Q1RYX8M2D
        version_number:
          type: integer
          description: Per-metric monotonic version number, 1-based
          example: 2
        change_type:
          $ref: '#/components/schemas/MetricVersionChangeType'
        metric_type:
          $ref: '#/components/schemas/MetricType'
        metric_metadata:
          type: object
          additionalProperties: true
          description: Verbatim scoring-config snapshot for this version
        label:
          type: string
          nullable: true
          description: Optional user-supplied tag
          example: v1.2 prod
        created_by:
          type: string
          description: Who created this version (email address)
        create_time:
          type: string
          format: date-time
          nullable: true
          description: When this version became current
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - INVALID_ARGUMENT
                - UNAUTHENTICATED
                - PERMISSION_DENIED
                - NOT_FOUND
                - ALREADY_EXISTS
                - INTERNAL
            message:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                    nullable: true
                  description:
                    type: string
    MetricVersionChangeType:
      type: string
      description: >-
        How a metric version came about. A revert is a save whose new state
        mirrors an older version.
      enum:
        - save
        - revert
    MetricType:
      type: string
      description: |
        Metric evaluation type.

        - `METRIC_LLM_BINARY` - Yes/no LLM evaluation
        - `METRIC_CATEGORICAL` - Multi-class classification
        - `METRIC_NUMERICAL_LLM_JUDGE` - Numerical scoring (1-N)
        - `METRIC_AUDIO_LLM_BINARY` - Audio-based yes/no
        - `METRIC_AUDIO_LLM_CATEGORICAL` - Audio-based classification
        - `METRIC_AUDIO_LLM_NUMERICAL` - Audio-based scoring
        - `METRIC_TOOLCALL` - Tool/function call evaluation
        - `METRIC_METADATA_FIELD` - Extract metadata field
        - `METRIC_TRANSCRIPT_REGEX` - Regex pattern matching
        - `METRIC_PAUSE_ANALYSIS` - Speech pause detection
      enum:
        - METRIC_LLM_BINARY
        - METRIC_CATEGORICAL
        - METRIC_NUMERICAL_LLM_JUDGE
        - METRIC_AUDIO_LLM_BINARY
        - METRIC_AUDIO_LLM_CATEGORICAL
        - METRIC_AUDIO_LLM_NUMERICAL
        - METRIC_TOOLCALL
        - METRIC_METADATA_FIELD
        - METRIC_TRANSCRIPT_REGEX
        - METRIC_PAUSE_ANALYSIS
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHENTICATED
              message: Authentication failed
              details:
                - field: X-API-Key
                  description: Invalid or missing API key
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: NOT_FOUND
              message: Metric not found
              details:
                - field: metric_id
                  description: No metric found with this ID
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Internal server error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````