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

# Create test case

> Create a test case in the project. It is created in draft and a burn-in run starts automatically.

IMPORTANT: gather context first, or the test will be flaky. This tool records the test exactly as you describe it. It does NOT explore the site to confirm the flow exists, so a vague or unverified goal produces low-value, flaky tests. Before calling, make sure you have:
- Verified the functionality, pages, and UI labels actually exist in the target environment. Do not guess or assume.
- A `goal` describing a single concrete user flow in plain UI terms, using generic data rather than specific entity names. Specific entities change over time and cause flakiness.
- An `expectedResult` stating a UI-observable outcome a user can see on screen.
- Prerequisites in place: a login/auth dependency via `resumeFromDependencyProjectTestCaseId` when the flow needs authentication, plus the right `configShortIds`.
- Checked existing tests with `list_test_cases` to avoid duplicates.

If you have not gathered this context, prefer `create_chat` instead. The QA.tech chat agent crawls the site, grounds the test in what actually exists, sets up login and config dependencies, and verifies the test runs. That is how reliable tests get created. Use this tool directly only when you already know the flow exists and have the details above.



## OpenAPI

````yaml /api-reference/api.json post /v1/test-cases
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
paths:
  /v1/test-cases:
    post:
      tags:
        - Test Cases
      summary: Create test case
      description: >-
        Create a test case in the project. It is created in draft and a burn-in
        run starts automatically.


        IMPORTANT: gather context first, or the test will be flaky. This tool
        records the test exactly as you describe it. It does NOT explore the
        site to confirm the flow exists, so a vague or unverified goal produces
        low-value, flaky tests. Before calling, make sure you have:

        - Verified the functionality, pages, and UI labels actually exist in the
        target environment. Do not guess or assume.

        - A `goal` describing a single concrete user flow in plain UI terms,
        using generic data rather than specific entity names. Specific entities
        change over time and cause flakiness.

        - An `expectedResult` stating a UI-observable outcome a user can see on
        screen.

        - Prerequisites in place: a login/auth dependency via
        `resumeFromDependencyProjectTestCaseId` when the flow needs
        authentication, plus the right `configShortIds`.

        - Checked existing tests with `list_test_cases` to avoid duplicates.


        If you have not gathered this context, prefer `create_chat` instead. The
        QA.tech chat agent crawls the site, grounds the test in what actually
        exists, sets up login and config dependencies, and verifies the test
        runs. That is how reliable tests get created. Use this tool directly
        only when you already know the flow exists and have the details above.
      operationId: CreateTestCase
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTestCaseRequest'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTestCaseResponse'
components:
  schemas:
    CreateTestCaseRequest:
      type: object
      required:
        - name
        - goal
        - applicationShortId
      properties:
        name:
          type: string
        goal:
          type: string
          minLength: 1
        expectedResult:
          type: string
        resumeFromDependencyProjectTestCaseId:
          type: string
        waitForDependenciesProjectTestCaseIds:
          type: array
          items:
            type: string
        configShortIds:
          type: array
          items:
            $ref: '#/components/schemas/ConfigShortId'
        applicationShortId:
          $ref: '#/components/schemas/ApplicationShortId'
        scenarioShortId:
          $ref: '#/components/schemas/ScenarioShortId'
        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: Request body for creating a new test case linked to a project
    CreateTestCaseResponse:
      type: object
      required:
        - success
        - testCase
      properties:
        success:
          type: boolean
        testCase:
          $ref: '#/components/schemas/TestCase'
    ConfigShortId:
      type: string
      pattern: ^cfg(-.+_.+|_.+)$
    ApplicationShortId:
      type: string
      pattern: ^app(-.+_.+|_.+)$
    ScenarioShortId:
      type: string
      pattern: ^scenario(-.+_.+|_.+)$
    ProjectShortId:
      type: string
      pattern: ^proj(-.+_.+|_.+)$
    TestCase:
      type: object
      required:
        - id
        - name
        - url
      properties:
        id:
          type: string
        name:
          type: string
        url:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````