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

# Create an AI quality test case

> Create a new test case (an AI-agent-bound ticket whose expected result is locked in) so it
can be replayed by future test runs. The body specifies the ticket id, target AI agent and
the expected result.




## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api post /aiQualityCheck/testCase
openapi: 3.0.0
info:
  version: '1'
  title: enneo.MIND API
  description: This describes the API of enneo Mind, the main ticketing backend
  contact:
    name: enneo GmbH
    email: richard@enneo.ai
  license:
    name: Proprietary software
    url: https://enneo.ai
servers:
  - url: https://demo.enneo.ai/api/mind
    description: Production server, demo client
  - url: https://main.enneo.dev/api/mind
    description: Development main branch
  - url: http://localhost:8005/api/mind
    description: Local development server
security:
  - bearerAuth:
      - api
  - cookieAuth:
      - api
paths:
  /aiQualityCheck/testCase:
    post:
      tags:
        - AI Quality Check
      summary: Create an AI quality test case
      description: >
        Create a new test case (an AI-agent-bound ticket whose expected result
        is locked in) so it

        can be replayed by future test runs. The body specifies the ticket id,
        target AI agent and

        the expected result.
      operationId: createAiQualityTestCase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ticketId:
                  type: integer
                  description: Ticket to use as the test case.
                aiAgentId:
                  type: integer
                  description: AI agent the test case is bound to.
                expectedResult:
                  $ref: '#/components/schemas/AiTestTicketResult'
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  testCase:
                    $ref: '#/components/schemas/AiTestCase'
components:
  schemas:
    AiTestTicketResult:
      type: object
      description: >-
        The updated expected result for the test ticket. You can either specify
        all test conditions, or only some. In this case only the provided test
        conditions will be provided
      properties:
        contractId:
          type: string
          example: '123456'
        inputParameters:
          type: object
          example:
            change_meter_reading:
              _action: null
              requestedDeposit: 35
        intentDetection:
          type: array
          items:
            type: string
          example:
            - change_meter_reading
            - change_payment_method
        outcomeActions:
          type: object
          example:
            change_meter_reading:
              - Update ERP System
              - Inform Customer change is not possible
        outcomeNotifications:
          type: object
          example:
            change_meter_reading:
              - Meter reading is plausible
        outcomeText:
          type: object
          example:
            change_meter_reading: null
        outcomeType:
          type: object
          example:
            change_meter_reading: interaction
        sentiment:
          type: string
          example: disappointed
        tags:
          type: array
          items:
            type: string
          example:
            - sales
            - marketing
        aiSupportLevel:
          type: string
          example: human
        sources:
          type: object
          description: The sources used by Cortex to generate the response
          example:
            change_meter_reading:
              - type: ticket
                id: '123'
                summary: Similar case
              - type: faq
                id: '456'
                title: How to change meter reading
        error:
          type: string
          example: null
          nullable: true
    AiTestCase:
      type: object
      description: >-
        Represents a test case for AI quality checks. A ticket that is assigned
        to AI agents with an expected result.

        During a specific test run, every test case is individually tested and
        the result is saved as a "test ticket".

        So if we have 10 test cases and 5 test runs, we will have 10*5=50 test
        tickets.

        Note: aiAgentIds are for reference only. Each test case generates ONE
        test ticket per test run, regardless of how many agents are in
        aiAgentIds.
      properties:
        id:
          type: integer
          nullable: true
          description: The ID of the test case. Null if not yet saved.
        ticketId:
          type: integer
          nullable: true
          description: >-
            The ID of the ticket that is being tested (null for chat/voice
            tests)
        aiAgentIds:
          type: array
          items:
            type: integer
          description: >-
            Array of AI agent IDs for reference only (indicates which agents
            this test case is meant for). Does not affect the number of test
            tickets created.
          example:
            - 1
            - 2
            - 3
        channel:
          type: string
          nullable: true
          description: The channel of the test case (email, chat, or phone)
        summary:
          type: string
          nullable: true
          description: The summary of the ticket. Pulled from ticket.summary
        description:
          type: string
          nullable: true
          description: A short description of the test case. Null if not yet set.
        expectedResult:
          type: object
          nullable: true
          description: The expected result of the test case
        modifiedBy:
          type: integer
          nullable: true
          description: The user ID of the user who last modified the test case
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT-based authentication
      x-scopes:
        api: Full access to the API
    cookieAuth:
      type: apiKey
      in: cookie
      name: connect.sid
      description: Cookie-based authentication
      x-scopes:
        api: Full access to the API

````