> ## 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 test cases

> List test cases for your organization.




## OpenAPI

````yaml /api-reference/v1/test-cases-v1.yaml get /test-cases
openapi: 3.0.3
info:
  title: Test Cases API
  version: 1.0.0
  description: |
    API for managing test cases - individual test inputs for evaluation.

    Test cases are standalone resources accessed at `/v1/test-cases`.
  contact:
    name: Coval API Support
    url: https://coval.dev
    email: support@coval.dev
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - apiKey: []
tags:
  - name: Test Cases
    description: Operations for managing test cases
paths:
  /test-cases:
    get:
      tags:
        - Test Cases
      summary: List test cases
      description: |
        List test cases for your organization.
      operationId: listTestCases
      parameters:
        - name: filter
          in: query
          description: >
            Filter expression syntax.

            Values may be unquoted or double-quoted. Values containing spaces
            must be quoted.

            Example: `test_set_id=abc12345`
          schema:
            type: string
          example: test_set_id=abc12345
        - name: page_size
          in: query
          description: Maximum number of test cases to return (default 50, max 100)
          schema:
            type: integer
            default: 50
            maximum: 100
        - name: page_token
          in: query
          description: Token for retrieving the next page of results
          schema:
            type: string
        - name: order_by
          in: query
          description: |
            Field to order results by. Prefix with `-` for descending order.
            Example: `-create_time` for newest first
          schema:
            type: string
            default: '-create_time'
          example: '-create_time'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  test_cases:
                    type: array
                    items:
                      $ref: '#/components/schemas/TestCaseResource'
                  next_page_token:
                    type: string
                    description: Token for retrieving the next page (empty if last page)
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    TestCaseResource:
      type: object
      description: Test case resource.
      properties:
        name:
          type: string
          description: Resource name in format `test-cases/{id}`
          example: test-cases/abc123def456ghi789jklm
        id:
          type: string
          description: Test case ID
          minLength: 22
          maxLength: 22
          example: abc123def456ghi789jklm
        test_set_id:
          type: string
          nullable: true
          description: Test set ID (8-character ID)
          minLength: 8
          maxLength: 8
          example: abc12345
        input_str:
          type: string
          description: Input for the test case
          example: What is the weather today?
        expected_output_str:
          type: string
          nullable: true
          description: Expected output string
          example: The weather is sunny with a high of 75 degrees.
        expected_output_json:
          type: object
          description: Expected output as JSON object
          additionalProperties: true
          example:
            temperature: 75
            condition: sunny
        description:
          type: string
          nullable: true
          description: Human-readable description of the test case
          example: Test case for weather query with sunny conditions
        input_type:
          type: string
          nullable: true
          description: |
            Type of input for the test case. Defaults to SCENARIO. When set
            to SCRIPT, the simulation_metadata_input should contain a
            script_turns field with ordered persona turn texts.
          enum:
            - SCENARIO
            - TRANSCRIPT
            - IVR
            - AUDIO
            - MANUAL
            - SCRIPT
          default: SCENARIO
          example: SCENARIO
        simulation_metadata_input:
          type: object
          description: |
            Metadata for simulation execution. Contents vary by input_type.
            When input_type is SCRIPT, this object should contain a
            script_turns field (array of strings) with the ordered lines
            for the persona to deliver.
          additionalProperties: true
          example:
            script_turns:
              - Hi, I'd like to check my account balance.
              - Yes, my account number is 12345.
              - Thank you, goodbye.
        metric_input:
          type: object
          description: Input data for metric calculations
          additionalProperties: true
          example:
            expected_entities:
              - weather
              - temperature
        user_notes:
          type: string
          nullable: true
          description: User-provided notes about the test case
          example: Added for regression testing weather queries
        create_time:
          type: string
          format: date-time
          description: Timestamp when test case was created
          example: '2025-10-14T12:00:00Z'
        update_time:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when test case was last updated
          example: '2025-10-15T14:30:00Z'
    ErrorResponse:
      type: object
      description: Standard error response
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: INVALID_ARGUMENT
            message:
              type: string
              description: Human-readable error message
              example: Invalid request parameters
            details:
              type: array
              description: Detailed error information
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: Field that caused the error
                    example: test_set_id
                  description:
                    type: string
                    description: Description of the error
                    example: test_set_id is required
  responses:
    Unauthorized:
      description: Authentication failed or missing API key
      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
              details:
                - description: An unexpected error occurred while processing the request
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key for authentication

````