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

# Start a test run

> Start a test run



## OpenAPI

````yaml https://api.stably.ai/openapi.json post /v1/projects/{projectId}/runs
openapi: 3.1.1
info:
  title: Stably Public API
  description: Interact with your Stably tests from anywhere
  version: 1.0.0
servers:
  - url: https://api.stably.ai
    description: Production Server
security: []
paths:
  /v1/projects/{projectId}/runs:
    post:
      tags:
        - runner
      summary: Start a test run
      description: Start a test run
      parameters:
        - schema:
            type: string
          in: path
          name: projectId
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              x-fastify-zod-openapi-optional: true
              anyOf:
                - type: object
                  properties:
                    playwrightProjectName:
                      description: >-
                        Playwright project name(s) to run. Maps to --project CLI
                        flag.
                      anyOf:
                        - type: string
                        - type: array
                          items:
                            type: string
                    runGroupName:
                      deprecated: true
                      description: Deprecated. Use playwrightProjectName instead.
                      anyOf:
                        - type: string
                        - type: array
                          items:
                            type: string
                    envOverrides:
                      type: object
                      properties: {}
                      additionalProperties:
                        type: string
                    environment:
                      description: >-
                        Name of the environment to use for this run (e.g.
                        "Staging", "Production"). When omitted, falls back to
                        the project's default environment.
                      type: string
                    environmentName:
                      deprecated: true
                      description: Deprecated. Use environment instead.
                      type: string
                    autofix:
                      description: >-
                        When true, automatically attempt to fix failing tests
                        after the run completes.
                      type: boolean
                    branch:
                      description: >-
                        Git branch to run tests against. When omitted, uses the
                        project's default branch.
                      example: staging/dev
                      type: string
                      minLength: 1
                      maxLength: 255
                - type: 'null'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  runId:
                    type: string
                    description: ID to use for polling the run status and results
                required:
                  - runId
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Bad request
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Internal server error
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````