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

> Create a test scenario (folder), optionally nested inside another. Returns the existing folder when one with the same name already exists under the same parent.



## OpenAPI

````yaml /api-reference/api.json post /v1/scenarios
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: Projects
  - name: Knowledge
  - name: Rules
  - name: Configs
  - name: Labels
  - name: Scenarios
  - name: Issues
  - name: Todos
  - name: Automations
  - name: Test plans
paths:
  /v1/scenarios:
    post:
      tags:
        - Scenarios
      summary: Create scenario
      description: >-
        Create a test scenario (folder), optionally nested inside another.
        Returns the existing folder when one with the same name already exists
        under the same parent.
      operationId: CreateScenario
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScenarioRequest'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateScenarioResponse'
components:
  schemas:
    CreateScenarioRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: >-
            Folder name, unique among its siblings. Creating a folder that
            already exists returns the existing one.
        parentScenarioShortId:
          allOf:
            - $ref: '#/components/schemas/ScenarioShortId'
          description: Nest the new folder inside this one. Omit to create it at the root.
        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.
    CreateScenarioResponse:
      type: object
      required:
        - success
        - scenario
      properties:
        success:
          type: boolean
        scenario:
          $ref: '#/components/schemas/ProjectScenario'
    ScenarioShortId:
      type: string
      pattern: ^scenario(-.+_.+|_.+)$
    ProjectShortId:
      type: string
      pattern: ^proj(-.+_.+|_.+)$
    ProjectScenario:
      type: object
      required:
        - shortId
        - name
        - path
        - parentScenarioShortId
        - testCaseCount
      properties:
        shortId:
          allOf:
            - $ref: '#/components/schemas/ScenarioShortId'
          description: >-
            Pass as `scenarioShortId` when creating or updating a test case,
            listing test cases, or scoping a rule.
        name:
          type: string
        path:
          type: string
          description: Full folder path from the root, such as `Checkout > Payments`.
        parentScenarioShortId:
          type: string
          allOf:
            - $ref: '#/components/schemas/ScenarioShortId'
          nullable: true
          description: Short ID of the folder this one is nested in, or null at the root.
        testCaseCount:
          type: integer
          format: int32
          description: >-
            Number of non-archived test cases directly in this folder, not
            counting nested folders.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````

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