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

# Get a test run by ID

> Get full details for a single test run, including per-case results. List test runs for the agent first to find test run IDs.



## OpenAPI

````yaml api-reference/agents/openapi.json GET /v1/agents/{agentId}/testing/test-runs/{testRunId}
openapi: 3.1.0
info:
  title: PolyAI Agents API
  version: 1.0.11
  description: Manage PolyAI agents, telephony, deployments, and real-time configs.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.eu.poly.ai
    description: EU region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.studio.poly.ai
    description: Studio region
security:
  - polyApiKey: []
paths:
  /v1/agents/{agentId}/testing/test-runs/{testRunId}:
    parameters:
      - name: agentId
        in: path
        required: true
        schema:
          type: string
      - name: testRunId
        in: path
        required: true
        schema:
          type: string
    get:
      tags:
        - Testing
      summary: Get a test run by ID
      description: >-
        Get full details for a single test run, including per-case results. List
        test runs for the agent first to find test run IDs.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestRunResponse'
        '401':
          description: Unauthorized – missing or invalid API key
        '403':
          description: Forbidden – insufficient permissions
        '404':
          description: Resource not found
components:
  schemas:
    TestRunResponse:
      type: object
      title: TestRunResponse
      description: >-
        A simulation test run against a deployment: its status, pass/fail
        counts, and (on single-run fetch) the history of each test case
        executed.
      properties:
        id:
          type: string
          description: Unique test run identifier
        name:
          type: string
          description: Test run name
        projectId:
          type: string
          description: Project this test run belongs to
        branchId:
          type:
            - string
            - 'null'
          description: Branch ID
        startedAt:
          type: string
          description: ISO 8601 start timestamp
        startedBy:
          type: string
          description: Email of the user who started the run
        updatedAt:
          type: string
          description: ISO 8601 last update timestamp
        artifactVersion:
          type: string
          description: Artifact version used
        lambdaDeploymentVersion:
          type:
            - string
            - 'null'
          description: Lambda deployment version
        deploymentId:
          type:
            - string
            - 'null'
          description: Deployment ID
        deployment:
          type:
            - object
            - 'null'
          description: Deployment info snapshot
        status:
          type: string
          description: Run status (pending, in_progress, completed)
        testCaseCount:
          type: integer
          description: Total test cases in the run
        passedCount:
          type: integer
          description: Number of passed test cases
        failedCount:
          type: integer
          description: Number of failed test cases
        errorCount:
          type: integer
          description: Number of errored test cases
        testSetId:
          type:
            - string
            - 'null'
          description: Test set ID if run from a set
        testHistory:
          type:
            - array
            - 'null'
          description: Test history events for this run (included on single-run fetch)
          items:
            $ref: '#/components/schemas/TestHistoryEventResponse'
      required:
        - id
        - name
        - projectId
        - startedAt
        - startedBy
        - updatedAt
        - artifactVersion
        - status
        - testCaseCount
        - passedCount
        - failedCount
        - errorCount
    TestHistoryEventResponse:
      type: object
      title: TestHistoryEventResponse
      description: >-
        One execution of a single test case within a test run: its result
        status, the conversation it produced, and pass/fail details.
      properties:
        id:
          type: string
          description: Unique history event identifier
        testCaseId:
          type: string
          description: Test case that was executed
        projectId:
          type:
            - string
            - 'null'
          description: Project ID
        testRunId:
          type:
            - string
            - 'null'
          description: Parent test run ID
        status:
          type: string
          description: >-
            Result status (pending, in_progress, passed, failed, errored,
            timed_out)
        rawConversation:
          type:
            - object
            - 'null'
          description: Raw conversation data
        results:
          type:
            - object
            - 'null'
          description: Test results with pass/fail details
        testCaseSnapshot:
          type:
            - object
            - 'null'
          description: Snapshot of the test case config at execution time
        artifactVersion:
          type: string
          default: ''
          description: Artifact version used
        lambdaDeploymentVersion:
          type:
            - string
            - 'null'
          description: Lambda deployment version
        deployment:
          type:
            - object
            - 'null'
          description: Deployment info snapshot
        deploymentId:
          type:
            - string
            - 'null'
          description: Deployment ID
        startedAt:
          type: string
          default: ''
          description: ISO 8601 start timestamp
        startedBy:
          type: string
          default: ''
          description: Email of the user who triggered the test
        updatedAt:
          type:
            - string
            - 'null'
          description: ISO 8601 last update timestamp
      required:
        - id
        - testCaseId
        - status
  securitySchemes:
    polyApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````