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

# Update test case

> Updates a test case's authored configuration. Patch semantics: only the fields you provide change; pass `null` on nullable fields (`startUrlPath`, `scenarioShortId`, `resumeFromDependencyProjectTestCaseId`) to clear them.

The edit takes effect immediately as a new published revision. To de-hardcode a test that 404s on a stale deep link, clear `startUrlPath` and set `resumeFromDependencyProjectTestCaseId` to a test that creates the entity it needs — it then starts from that test's end state with fresh data.



## OpenAPI

````yaml /api-reference/api.json patch /v1/test-cases/{id}
openapi: 3.0.0
info:
  title: QA.tech API
  version: 1.0.0
  contact:
    name: QA.tech
    url: https://qa.tech
    email: support@qa.tech
  description: API for triggering and managing AI-powered test runs
servers:
  - url: https://api.qa.tech
    description: Production
    variables: {}
security:
  - BearerAuth: []
tags:
  - name: Runs
  - name: Infrastructure
  - name: Test Cases
  - name: Application Builds
  - name: Status badge
  - name: Remote Tunnels
  - name: Chat
  - name: Applications
  - name: Features
  - name: Metrics
  - name: Release Checks
  - name: Projects
  - name: Knowledge
  - name: Rules
paths:
  /v1/test-cases/{id}:
    patch:
      tags:
        - Test Cases
      summary: Update test case
      description: >-
        Updates a test case's authored configuration. Patch semantics: only the
        fields you provide change; pass `null` on nullable fields
        (`startUrlPath`, `scenarioShortId`,
        `resumeFromDependencyProjectTestCaseId`) to clear them.


        The edit takes effect immediately as a new published revision. To
        de-hardcode a test that 404s on a stale deep link, clear `startUrlPath`
        and set `resumeFromDependencyProjectTestCaseId` to a test that creates
        the entity it needs — it then starts from that test's end state with
        fresh data.
      operationId: UpdateTestCase
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTestCaseRequest'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCaseDetail'
components:
  schemas:
    UpdateTestCaseRequest:
      type: object
      properties:
        name:
          type: string
        goal:
          type: string
          minLength: 1
          description: The test's goal — what the agent tries to achieve.
        expectedResult:
          type: string
          description: >-
            The expected result, stated as a UI-observable outcome that proves
            the goal was met.
        steps:
          type: array
          items:
            type: string
          description: >-
            Full replacement list of step instructions, one action per step in
            user-visible UI language. Pass an empty array to remove all steps
            and rely on the goal alone.
        startUrlPath:
          type: string
          nullable: true
          description: >-
            URL path the agent navigates to before executing (e.g.
            `/dashboard`). Pass `null` to clear it so the test starts from its
            RESUME_FROM dependency's end state (or the application's base URL
            without one) — do not set a path on a test that has a RESUME_FROM
            dependency, as it would navigate away from the dependency's end
            state.
        labels:
          type: array
          items:
            type: string
          description: Full replacement list of labels.
        isEnabled:
          type: boolean
        classification:
          type: string
          enum:
            - POSITIVE
            - NEGATIVE
          description: '`POSITIVE` (expected to succeed) or `NEGATIVE` (expected to fail).'
        scenarioShortId:
          type: string
          allOf:
            - $ref: '#/components/schemas/ScenarioShortId'
          nullable: true
          description: >-
            Move the test into an existing scenario (folder). Pass `null` to
            remove it from its current scenario.
        resumeFromDependencyProjectTestCaseId:
          type: string
          nullable: true
          description: >-
            Test case (UUID) whose output state this test resumes from — the
            preferred way to give a test fresh, valid data instead of hardcoded
            entities. Pass `null` to remove the RESUME_FROM dependency. Combine
            with `startUrlPath: null` so the test actually starts from the
            dependency's end state.
        waitForDependenciesProjectTestCaseIds:
          type: array
          items:
            type: string
          description: >-
            Full replacement list of test cases (UUIDs) that must finish before
            this one runs (WAIT_FOR — ordering only). Pass an empty array to
            remove all WAIT_FOR dependencies. Must not overlap with the
            RESUME_FROM dependency.
        projectShortId:
          allOf:
            - $ref: '#/components/schemas/ProjectShortId'
          description: >-
            Target a specific project by its prefixed short ID
            (proj-slug_shortId or proj_shortId), as returned by the projects
            API. Required for organization-scoped API keys; project-scoped keys
            may only pass their own project's short ID.
      description: >-
        Patch-style update: omitted fields are left unchanged. Nullable fields
        (`startUrlPath`, `scenarioShortId`,
        `resumeFromDependencyProjectTestCaseId`) accept `null` to clear the
        current value.
    TestCaseDetail:
      type: object
      required:
        - id
        - name
        - isEnabled
        - labels
        - classification
        - applicationShortId
        - applicationName
        - scenarioShortId
        - scenarioName
        - goal
        - expectedResult
        - steps
        - startUrlPath
        - resumeFromDependencyProjectTestCaseId
        - waitForDependenciesProjectTestCaseIds
        - createdAt
        - updatedAt
        - url
      properties:
        id:
          type: string
          description: >-
            Project test case ID (UUID). Works with `update_test_case`,
            `start_run_with_test_cases` (`testCaseIds`), and `rerun_run`
            (`projectTestCaseIds`).
        name:
          type: string
        isEnabled:
          type: boolean
        labels:
          type: array
          items:
            type: string
        classification:
          type: string
          enum:
            - POSITIVE
            - NEGATIVE
          description: '`POSITIVE` (expected to succeed) or `NEGATIVE` (expected to fail).'
        applicationShortId:
          $ref: '#/components/schemas/ApplicationShortId'
        applicationName:
          type: string
        scenarioShortId:
          type: string
          allOf:
            - $ref: '#/components/schemas/ScenarioShortId'
          nullable: true
          description: >-
            Scenario (folder grouping related test cases) the test belongs to.
            `null` when ungrouped.
        scenarioName:
          type: string
          nullable: true
        goal:
          type: string
          nullable: true
          description: The test's goal — what the agent tries to achieve.
        expectedResult:
          type: string
          nullable: true
          description: The expected result / success criteria the evaluator checks against.
        steps:
          type: array
          items:
            type: string
          description: >-
            Authored step instructions, in order. Empty when the test only has a
            goal.
        startUrlPath:
          type: string
          nullable: true
          description: >-
            URL path the agent navigates to before executing (e.g.
            `/dashboard`). `null` means the test starts from its RESUME_FROM
            dependency's end state, or the application's base URL when it has no
            dependency.
        resumeFromDependencyProjectTestCaseId:
          type: string
          nullable: true
          description: >-
            Test case whose output state this test resumes from (RESUME_FROM).
            `null` when the test starts fresh.
        waitForDependenciesProjectTestCaseIds:
          type: array
          items:
            type: string
          description: >-
            Test cases that must finish before this one runs (WAIT_FOR —
            ordering only, no state carry-over).
        createdAt:
          type: string
        updatedAt:
          type: string
          nullable: true
        url:
          type: string
          description: Deep link to edit the test case in the QA.tech UI.
      description: >-
        A test case's authored configuration — what the agent is instructed to
        do — as distinct from a run's result (see `get_run_test_case`).
    ScenarioShortId:
      type: string
      pattern: ^scenario(-.+_.+|_.+)$
    ProjectShortId:
      type: string
      pattern: ^proj(-.+_.+|_.+)$
    ApplicationShortId:
      type: string
      pattern: ^app(-.+_.+|_.+)$
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````