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

# Update test case

> Update an existing test case. See [Datasets](https://docs.galtea.ai/concepts/product/dataset).

> [!WARNING]
>
> You are reading the docs of Galtea 5.17. [Read this page in the latest version](https://docs.galtea.ai/api-reference/test-cases/update-test-case.md).


## OpenAPI

````yaml /v5.17/openapi.json patch /testCases/{id}
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/{id}:
    patch:
      tags:
        - test-cases
      summary: Update test case
      description: >-
        Update an existing test case. See
        [Datasets](https://docs.galtea.ai/concepts/product/dataset).
      operationId: updateTestCase
      parameters:
        - name: id
          in: path
          description: Test case ID
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestCase'
      responses:
        '200':
          description: Test case updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCase'
        '400':
          description: Invalid body, or a predefined conversation the test cannot hold
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Test case not found
          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: "..." }. Uploaded files ride a `content` array of
            parts, each `{ type: "file", uri, filename, mimeType }`, beside an
            optional `user_message`. A file part is a Galtea file when its uri
            names a Galtea storage key (`files/<organization>/<32
            hex>.<extension>`); every other element is stored as sent. For a
            Galtea file, `mimeType` is filled from the stored object when
            omitted, and `filename` is filled only where the storage records it:
            AWS does, Azure Blob does not, so send `filename` on an Azure
            deployment. Every Galtea file part is returned with a
            server-measured `sizeBytes`; a value sent for it is ignored.
          example:
            user_message: Summarize this contract
            content:
              - type: file
                uri: >-
                  https://files.galtea.ai/files/org_123/2f6c0a9e41b84d7f9c3e5a1b2d4f6e80.pdf
                filename: contrato-arrendamiento.pdf
                mimeType: application/pdf
                sizeBytes: 1468006
        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. A bare code for ca, de, es, eu, fr, gl, it, nl or pt
            defaults to the European variety of that language, in simulated user
            messages only (pt -> pt-PT); an explicit region always overrides it,
            and neither voice synthesis nor the stored value is affected.
        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. A voice
            pinned for the call's locale takes precedence. 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.
        conversationHistory:
          type: array
          writeOnly: true
          description: >-
            Predefined conversation for this SCENARIOS test case. The API stores
            it as a seed session and returns that session id in seedSessionId.
            Write-only: the array itself is never echoed back, read the
            predefined conversation through the seed session. Sending it again
            replaces the predefined conversation; an identical array changes
            nothing. Omit the field to leave the predefined conversation
            untouched; null is rejected. Cannot be sent together with
            seedSessionId, which is the other way to give this test case a
            conversation.
          items:
            type: object
            required:
              - role
              - content
            properties:
              role:
                type: string
                enum:
                  - user
                  - assistant
                example: user
              content:
                type: string
                example: I want to open an account
        seedSessionId:
          type: string
          nullable: true
          description: >-
            Read and write mean different things here, and the two ids are never
            the same session. On a response it is the seed session holding this
            test case predefined conversation, or null when it has none. On a
            request it is the SOURCE session to copy, which must be a session of
            this test product. The API answers with the id of the copy it made,
            never with the id you sent. Omit it, send null, or send back the id
            the response gave you, and the predefined conversation stays as it
            is. There is no way to remove a predefined conversation. Cannot be
            sent together with conversationHistory, the other way to give this
            test case a conversation.
        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-...`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.