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

# Run many test cases

> Executes a batch of test cases against a prompt version. Selection precedence: explicit `testCaseIds`, else the canvas's test cases matching `filters`, else every test case of the canvas.



## OpenAPI

````yaml POST /test-case/run-all
openapi: 3.0.1
info:
  title: Tela API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tela.com
security: []
paths:
  /test-case/run-all:
    post:
      tags:
        - Test Case
      summary: Run many test cases
      description: >
        Executes a batch of test cases against a prompt version. Selection
        precedence: explicit `testCaseIds`, else

        the canvas's test cases matching `filters`, else every test case of the
        canvas. Test cases that already have

        a generation in progress for that version are skipped; when nothing is
        left to run, `executionId` is an

        empty string and both arrays are empty.


        Workflow versions must be consolidated (not `draft`) to run. Counts
        towards the workspace inference quota.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestCaseRunAllRequest'
      responses:
        '200':
          description: Batch execution started.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCaseRunAllResponse'
        '400':
          description: The version is a workflow draft and must be consolidated first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Workspace inference quota exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Prompt version not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Body failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    TestCaseRunAllRequest:
      type: object
      properties:
        promptVersionId:
          type: string
          format: uuid
        testCaseIds:
          type: array
          description: Explicit test cases to run. Takes precedence over `filters`.
          items:
            type: string
            format: uuid
        filters:
          type: object
          description: >-
            Selects test cases of the version's canvas when `testCaseIds` is
            omitted. Same filters as `GET /test-case`.
          properties:
            createdAtSince:
              type: string
              format: date-time
            createdAtUntil:
              type: string
              format: date-time
            updatedAtSince:
              type: string
              format: date-time
            updatedAtUntil:
              type: string
              format: date-time
            createdBy:
              type: array
              items:
                type: string
            testCaseTitle:
              type: string
            status:
              type: array
              description: >-
                Test case status filter values, e.g. `completed`, `failed`,
                `pending_run`, `pending_review`, `partially_reviewed`.
              items:
                type: string
            tagIds:
              type: array
              items:
                type: string
                format: uuid
      required:
        - promptVersionId
    TestCaseRunAllResponse:
      type: object
      properties:
        executionId:
          type: string
          description: Batch job id. Empty string when nothing was started.
        executionIds:
          type: array
          description: >-
            Currently a single-element array containing `executionId`, or empty
            when nothing was started.
          items:
            type: string
        testCaseIds:
          type: array
          description: >-
            Test cases that were actually started (already-running ones are
            excluded).
          items:
            type: string
            format: uuid
      required:
        - executionId
        - executionIds
        - testCaseIds
      example:
        executionId: batch_01J9Z8Q4M6N2P8R1S3T5V7W9X
        executionIds:
          - batch_01J9Z8Q4M6N2P8R1S3T5V7W9X
        testCaseIds:
          - 2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d
          - 3b4c5d6e-7f8a-4b9c-8d1e-2f3a4b5c6d7e
    Error: {}
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or UUID

````

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