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

# Wait for runs

> Wait until runs finish or the time is up.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json post /v1/stable/test-run/wait
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/test-run/wait:
    post:
      tags:
        - Test Run
      summary: Wait for runs
      description: Wait until runs finish or the time is up.
      operationId: StableTestRunController_wait
      parameters:
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
        - name: environmentAlias
          required: true
          in: query
          schema:
            type: string
            description: The alias of the environment to operate on (e.g. `main`).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StableTestRunWaitRequest"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableTestRunWaitResponse"
      security:
        - token: []
components:
  schemas:
    StableTestRunWaitRequest:
      type: object
      properties:
        runIDs:
          minItems: 1
          maxItems: 50
          type: array
          items:
            type: string
            minLength: 1
          description: "The runs to wait for: the IDs create_run or create_many_runs
            returned (each run's `id`, not its `testID`)."
        timeoutSeconds:
          default: 45
          description: "How long to wait at most, in seconds: 45 by default, 120 at most."
          type: integer
          minimum: 5
          maximum: 120
      required:
        - runIDs
      additionalProperties: false
    StableTestRunWaitResponse:
      type: object
      properties:
        done:
          type: boolean
          description: Every run found has passed, failed or been canceled.
        stoppedBy:
          type: string
          enum:
            - finished
            - timeout
            - abort
          x-enumNames:
            - FINISHED
            - TIMEOUT
            - ABORT
        waitedSeconds:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        runs:
          type: array
          items:
            type: object
            properties:
              runID:
                type: string
              testID:
                type: string
              status:
                type: string
                enum:
                  - idle
                  - pending
                  - running
                  - failed
                  - passed
                  - canceled
                x-enumNames:
                  - IDLE
                  - PENDING
                  - RUNNING
                  - FAILED
                  - PASSED
                  - CANCELED
              passedChecks:
                nullable: true
                type: number
              totalChecks:
                type: number
              failReason:
                nullable: true
                type: string
              failedChecks:
                type: array
                items:
                  type: object
                  properties:
                    checkID:
                      nullable: true
                      type: string
                    type:
                      nullable: true
                      type: string
                    reason:
                      type: string
                  required:
                    - checkID
                    - type
                    - reason
              logsIncomplete:
                description: The run finished before all its logs were stored.
                type: boolean
            required:
              - runID
              - testID
              - status
              - passedChecks
              - totalChecks
              - failReason
        notFoundRunIDs:
          type: array
          items:
            type: string
        note:
          type: string
      required:
        - done
        - stoppedBy
        - waitedSeconds
        - runs
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
