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

# Create test case

> Create a new test case. See [Tests](https://docs.galtea.ai/concepts/product/test).



## OpenAPI

````yaml https://api.galtea.ai/openapi.json post /testCases
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /testCases:
    post:
      tags:
        - test-cases
      summary: Create test case
      description: >-
        Create a new test case. See
        [Tests](https://docs.galtea.ai/concepts/product/test).
      operationId: createTestCase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestCase'
      responses:
        '201':
          description: Test case created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCase'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    TestCase:
      type: object
      properties:
        id:
          type: string
          example: tc_123
        testId:
          type: string
          example: test_123
        userId:
          type: string
          nullable: true
          example: user_123
        input:
          type: object
          nullable: true
          description: >-
            Structured input data. For plain text input, format is {
            user_message: "..." }
          example:
            user_message: What is the capital of France?
        expectedOutput:
          type: string
          nullable: true
          example: Paris
        expectedTools:
          type: array
          items:
            type: string
          example:
            - search
            - calculator
        context:
          type: object
          nullable: true
          description: >-
            Structured context data. For plain text context, format is { value:
            "..." }
          example:
            value: Geography question
        source:
          type: string
          nullable: true
          example: manual
        sourceFile:
          type: string
          nullable: true
        confidence:
          type: number
          nullable: true
          example: 0.95
        confidenceReason:
          type: string
          nullable: true
          example: High quality data
        variant:
          type: string
          nullable: true
          example: VARIANT_1
        strategy:
          type: string
          nullable: true
          example: STRATEGY_1
        languageCode:
          type: string
          nullable: true
          example: es-MX
          description: >-
            BCP-47 language tag (e.g. en, es-MX). The region subtag selects the
            regional variety in simulated user messages and voice synthesis;
            generated test text keeps the base language. The value is stored as
            the full tag.
        gender:
          type: string
          nullable: true
          enum:
            - MALE
            - FEMALE
          example: FEMALE
          description: >-
            Persona-derived gender ("MALE"/"FEMALE") for the male/female
            synthesized caller voice in phone (voice) evaluations. Stored only
            for now (not consumed yet). Ignored by text evaluations.
        backgroundNoiseProfile:
          type: string
          nullable: true
          enum:
            - office
            - street
            - car
            - white
            - pink
          example: street
          description: >-
            Background noise mixed into the simulated caller audio during a
            voice test. Clip-backed (office, street, car) or synthetic (white,
            pink). Null means off; set together with backgroundNoiseLevel.
        backgroundNoiseLevel:
          type: string
          nullable: true
          enum:
            - light
            - medium
            - heavy
          example: medium
          description: >-
            How loud the background noise is relative to the caller speech. Null
            means off; set together with backgroundNoiseProfile.
        userPersona:
          type: string
          nullable: true
          example: Student
        scenario:
          type: string
          nullable: true
          example: Educational quiz
        goal:
          type: string
          nullable: true
          example: Test geographical knowledge
        archetype:
          type: string
          nullable: true
          example: data_grounded
        specRelevance:
          type: string
          nullable: true
          example: direct
        stoppingCriterias:
          type: array
          items:
            type: string
          example:
            - MAX_ITERATIONS
            - GOAL_ACHIEVED
        maxIterations:
          type: integer
          nullable: true
          example: 10
        isAugmented:
          type: boolean
          example: false
        reviewedById:
          type: string
          nullable: true
          example: user_456
        userScore:
          type: integer
          nullable: true
          example: 5
        userScoreReason:
          type: string
          nullable: true
          example: Accurate and complete
        creditsUsed:
          type: integer
          nullable: true
          example: 1
        sourceTestCaseId:
          type: string
          nullable: true
        testCaseGroupId:
          type: string
          nullable: true
          description: Revision family key shared by every revision of this test case.
          example: testCaseGroup_123
        parentTestCaseId:
          type: string
          nullable: true
          description: The revision this row was forked from; null for a family root.
        legacyAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            Set when this revision was superseded by a newer one; null for the
            active head.
        createdAt:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````