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

# Test evaluate a monitor

> Dry-run evaluation of a monitor against a specific run.

Evaluates all conditions and builds the notification message,
but does **not** dispatch notifications or write an event record.
Use this to preview what would happen if the monitor evaluated
against a given run.




## OpenAPI

````yaml /api-reference/v1/monitors-v1.yaml post /monitors/{monitor_id}/test-evaluate
openapi: 3.0.3
info:
  title: Coval Monitors API
  version: 1.0.0
  description: |
    API for managing monitors — metric-based alerting rules that evaluate
    on run completion and dispatch notifications to configured channels.

    Monitors support:
    - Per-run metric checks (single value, run average, run fraction)
    - AND/OR condition logic across multiple metrics
    - Multi-channel notifications (Slack, email, webhook, human review)
    - Cooldown/deduplication
    - Custom message templates
  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
security:
  - ApiKeyAuth: []
tags:
  - name: Monitors
    description: CRUD operations for monitor definitions
  - name: Monitor Events
    description: Monitor evaluation event history
paths:
  /monitors/{monitor_id}/test-evaluate:
    post:
      tags:
        - Monitors
      summary: Test evaluate a monitor
      description: |
        Dry-run evaluation of a monitor against a specific run.

        Evaluates all conditions and builds the notification message,
        but does **not** dispatch notifications or write an event record.
        Use this to preview what would happen if the monitor evaluated
        against a given run.
      operationId: testEvaluateMonitor
      parameters:
        - $ref: '#/components/parameters/MonitorId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestEvaluateRequest'
            example:
              run_id: hUWu3PxY6G7fTYbLzBAwZm
      responses:
        '200':
          description: Test evaluation results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestEvaluateResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/PermissionDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    MonitorId:
      name: monitor_id
      in: path
      required: true
      schema:
        type: string
        pattern: ^[0-9A-Z]{26}$
      description: Monitor ULID
      example: 01HZ0EXAMPLE00000000000000
  schemas:
    TestEvaluateRequest:
      type: object
      required:
        - run_id
      properties:
        run_id:
          type: string
          description: Run ID to evaluate the monitor against
    TestEvaluateResponse:
      type: object
      required:
        - monitor_id
        - run_id
        - triggered
      properties:
        monitor_id:
          type: string
          description: Monitor ULID
        run_id:
          type: string
          description: Run that was evaluated
        triggered:
          type: boolean
          description: Whether the monitor would have triggered
        suppressed:
          type: boolean
          default: false
          description: Whether cooldown would have suppressed the trigger
        condition_results:
          type: array
          items:
            type: object
          description: Per-condition evaluation results
        dispatch_results:
          type: array
          items:
            type: object
          description: Empty for dry-run (no dispatching)
        message:
          type: string
          description: Generated notification message
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              enum:
                - INVALID_ARGUMENT
                - UNAUTHENTICATED
                - PERMISSION_DENIED
                - NOT_FOUND
                - ALREADY_EXISTS
                - INTERNAL
            message:
              type: string
              description: Human-readable error message
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                    nullable: true
                  description:
                    type: string
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INVALID_ARGUMENT
              message: Invalid request body
              details:
                - field: conditions
                  description: >-
                    Value error, List should have at least 1 item after
                    validation
    Unauthorized:
      description: Unauthorized
      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
    PermissionDenied:
      description: Permission Denied
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: PERMISSION_DENIED
              message: Insufficient permissions
              details:
                - field: permissions
                  description: 'Required scope: monitors:read'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: NOT_FOUND
              message: Monitor not found
              details:
                - field: monitor_id
                  description: Monitor '01HZ0EXAMPLE00000000000000' not found
    InternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Internal server error
              details:
                - description: An unexpected error occurred
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````