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

# Get baseline history

> Baseline mean/sigma history over time buckets.



## OpenAPI

````yaml /api-reference/v1/metrics-v1.yaml get /metrics/{metric_id}/baselines/{baseline_id}/history
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}/baselines/{baseline_id}/history:
    get:
      tags:
        - Metrics
      summary: Get baseline history
      description: Baseline mean/sigma history over time buckets.
      operationId: getMetricBaselineHistory
      parameters:
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
          description: Metric ID.
        - name: baseline_id
          in: path
          required: true
          schema:
            type: string
          description: Baseline ULID.
        - name: bucket_interval
          in: query
          required: false
          schema:
            type: string
          description: Bucket width (e.g. "4 hours"; default "4 hours").
        - name: timezone
          in: query
          required: false
          schema:
            type: string
          description: IANA timezone for bucketing (default UTC).
        - name: start_date
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          required: false
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Baseline mean/sigma history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaselineHistoryResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    BaselineHistoryResponse:
      type: object
      required:
        - history
      properties:
        history:
          type: array
          items:
            $ref: '#/components/schemas/BaselineHistoryPoint'
    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
    BaselineHistoryPoint:
      type: object
      required:
        - bucket_time
        - baseline_mean
        - baseline_sigma
        - observation_count
      properties:
        bucket_time:
          type: string
          format: date-time
        baseline_mean:
          type: number
        baseline_sigma:
          type: number
        observation_count:
          type: integer
  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
    ServiceUnavailable:
      description: Service temporarily unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Service temporarily unavailable
              details:
                - description: Database routing is temporarily unavailable. Please retry.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````