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

# Batch-get metric outputs by ULID

> Resolve up to 100 metric-output ULIDs to their full metric-output resources. Use this to
read the results of `POST /v1/metrics/{metric_id}/test` — which returns a `metric_output_ulid`
— without having to know the parent simulation. Org-scoped and best-effort: ULIDs that do not
exist or belong to another organization are omitted from the response rather than erroring, so
the returned list may be shorter than the request (and empty if none match). Returns the same
`SimpleMetricOutput` shape as `GET /v1/simulations/{simulation_id}/metrics/{metric_output_id}`.




## OpenAPI

````yaml /api-reference/v1/metrics-v1.yaml post /metrics/outputs:batchGet
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/outputs:batchGet:
    post:
      tags:
        - Metrics
      summary: Batch-get metric outputs by ULID
      description: >
        Resolve up to 100 metric-output ULIDs to their full metric-output
        resources. Use this to

        read the results of `POST /v1/metrics/{metric_id}/test` — which returns
        a `metric_output_ulid`

        — without having to know the parent simulation. Org-scoped and
        best-effort: ULIDs that do not

        exist or belong to another organization are omitted from the response
        rather than erroring, so

        the returned list may be shorter than the request (and empty if none
        match). Returns the same

        `SimpleMetricOutput` shape as `GET
        /v1/simulations/{simulation_id}/metrics/{metric_output_id}`.
      operationId: batchGetMetricOutputs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchGetMetricOutputsRequest'
      responses:
        '200':
          description: The resolved metric outputs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricOutputCollection'
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: Service temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BatchGetMetricOutputsRequest:
      type: object
      required:
        - metric_output_ids
      properties:
        metric_output_ids:
          type: array
          description: Metric-output ULIDs (26-char) to resolve; 1–100 per call.
          items:
            type: string
            minLength: 26
            maxLength: 26
            pattern: ^[a-zA-Z0-9]{26}$
      additionalProperties: false
    MetricOutputCollection:
      type: object
      required:
        - metric_outputs
      description: A set of resolved metric outputs.
      properties:
        metric_outputs:
          type: array
          items:
            $ref: '#/components/schemas/SimpleMetricOutput'
    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
    SimpleMetricOutput:
      type: object
      required:
        - metric_output_id
        - metric_id
        - status
      properties:
        metric_output_id:
          type: string
          minLength: 26
          maxLength: 26
          description: Unique metric output identifier (26-char ULID)
          example: 01JCQR8Z9PQSTNVWXY12345678
        metric_id:
          type: string
          description: Metric definition identifier
          example: abc123xyz789
        metric_version_ulid:
          type: string
          nullable: true
          minLength: 26
          maxLength: 26
          description: >-
            ULID of the metric version this output was scored against (null for
            outputs produced before metric versioning landed).
          example: 01JCQR8Z9PQSTNVWXY12345678
        value:
          description: >-
            Metric value (float, string, or list of strings). Can be null if not
            yet computed.
          example: 0.85
          oneOf:
            - type: number
            - type: string
            - type: array
              items:
                type: string
        status:
          type: string
          enum:
            - IN QUEUE
            - IN PROGRESS
            - COMPLETED
            - FAILED
          description: Current status of the metric computation
          example: COMPLETED
        explanation:
          type: string
          nullable: true
          description: >-
            The LLM judge's reasoning for this metric output, as a flat string.
            Null for metrics that produce no explanation (non-judge metrics) or
            when the output is not yet computed.
          example: >-
            The agent never confirmed the caller's address before ending the
            call.
        subvalues_by_timestamp:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/SubvalueByTimestamp'
          description: Time-series metric values anchored to time ranges
        result:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Structured metric result. Its keys depend on the metric type. Null
            for metrics that produce no structured result.
        runtime_metadata:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            How the metric was computed at runtime (model version, trace
            context). Null when not recorded.
    SubvalueByTimestamp:
      type: object
      required:
        - start_offset
        - end_offset
        - output_type
      properties:
        start_offset:
          type: number
          description: Start position in seconds
          example: 0
        end_offset:
          type: number
          description: End position in seconds
          example: 2.5
        output_type:
          type: string
          enum:
            - float
            - string
            - set
          description: Value type
          example: float
        float_value:
          type: number
          description: Numeric value (when output_type is float)
          default: 0
          example: 0.85
        string_value:
          type: string
          description: String value (when output_type is string)
          default: ''
          example: ''
        role:
          type: string
          nullable: true
          description: Speaker role for this interval (e.g. user, assistant)
          example: assistant
        message_index:
          type: integer
          nullable: true
          description: 0-based transcript message index
          example: 3
  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
    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

````