> ## 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 test execution history for a project

> List individual test-case execution events for an agent over time, optionally filtered by test case or branch. Use this to see pass/fail trends, distinct from a single test run's snapshot.



## OpenAPI

````yaml api-reference/agents/openapi.json GET /v1/agents/{agentId}/testing/test-history
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-history:
    parameters:
      - name: agentId
        in: path
        required: true
        schema:
          type: string
    get:
      tags:
        - Testing
      summary: Get test execution history for a project
      description: >-
        List individual test-case execution events for an agent over time,
        optionally filtered by test case or branch. Use this to see pass/fail
        trends, distinct from a single test run's snapshot.
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 100
          description: Max number of history entries to return
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of history entries to skip
        - name: testCaseId
          in: query
          required: false
          schema:
            type: string
          description: Filter by test case ID
        - name: branchId
          in: query
          required: false
          schema:
            type: string
          description: Filter by branch ID
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTestHistoryResponse'
        '401':
          description: Unauthorized – missing or invalid API key
        '403':
          description: Forbidden – insufficient permissions
components:
  schemas:
    GetTestHistoryResponse:
      type: object
      title: GetTestHistoryResponse
      description: Individual test case executions matching the query, most recent first.
      properties:
        testHistory:
          type: array
          description: List of test history events
          items:
            $ref: '#/components/schemas/TestHistoryEventResponse'
      required:
        - testHistory
    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

````