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

# Start a test run

> Trigger a new run for a specific test. Returns immediately with a queued run object. Poll `GET /test-runs/{runId}` until the status becomes `passed` or `failed`.

The test must have completed validation to be executed.



## OpenAPI

````yaml POST /api/v1/tests/{testId}/runs
openapi: 3.0.3
info:
  title: Decipher API
  version: 1.0.0
  description: >-
    API for retrieving test run data from Decipher. Use your API key to
    authenticate requests.
servers:
  - url: https://api.getdecipher.com
    description: Production
security: []
paths:
  /api/v1/tests/{testId}/runs:
    post:
      summary: Start a test run
      description: >-
        Trigger a new run for a specific test. Returns immediately with a queued
        run object. Poll `GET /test-runs/{runId}` until the status becomes
        `passed` or `failed`.


        The test must have completed validation to be executed.
      parameters:
        - schema:
            type: string
            description: The ID of the test to run
            example: '456'
          required: true
          description: The ID of the test to run
          name: testId
          in: path
      responses:
        '200':
          description: Run created and queued for execution
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartTestRunResponse'
        '400':
          description: Invalid parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Test not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: Test is not ready (no completed validation)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth: []
components:
  schemas:
    StartTestRunResponse:
      type: object
      properties:
        object:
          type: string
          enum:
            - testRun
        id:
          type: number
          example: 12345
        testId:
          type: number
          example: 456
        testUrl:
          type: string
          description: Decipher dashboard link for the test
          example: https://app.getdecipher.com/tests/456
        runUrl:
          type: string
          description: Decipher dashboard link for this run
          example: https://app.getdecipher.com/tests/456/runs/12345
        status:
          type: string
          enum:
            - queued
          description: >-
            The run is queued for execution. Poll GET /test-runs/:runId until
            status becomes passed or failed.
        startedAt:
          type: string
          description: ISO timestamp when the run was created
          example: '2026-02-16T05:00:00.000Z'
      required:
        - object
        - id
        - testId
        - testUrl
        - runUrl
        - status
        - startedAt
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - authentication_error
                - authorization_error
                - not_found_error
                - validation_error
                - rate_limit_error
                - api_error
            code:
              type: string
            message:
              type: string
            field:
              type: string
          required:
            - type
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Use your Decipher API key as the bearer token.

````