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

# Get execution history for a test case by title

> Returns the execution history of a test case identified by its visible `title` (the name
shown in the UI). Internally, the title is resolved to the canonical full title
(`path/to/spec > describe > title`) by matching the most recently executed test case.
Each entry represents one execution with its status, duration, retries, platform, branch,
and associated test run counter.

Also includes pre-computed summary metrics (execution count, pass/fail/flaky rates, average
duration), unique errors encountered, and per-platform and per-environment breakdowns.

Results are ordered by test run start time (newest first). Use `offset` and `limit` for pagination.




## OpenAPI

````yaml /api-reference/openapi.yml get /{projectId}/test-cases/history
openapi: 3.0.3
info:
  title: TestDino Public API
  version: 1.0.0
  description: >
    Public API for TestDino — read-only access to test analytics, manual tests,
    and project data.


    **17 read-only GET endpoints** organized into 12 sections. Query parameters
    are **endpoint-specific** —

    see each operation for supported filters, enums, and defaults.


    ## Authentication


    All endpoints require a Bearer token in the `Authorization` header:

    ```

    Authorization: Bearer td_pat_<token>

    ```


    Use a user PAT (`td_pat_` prefix) scoped to the organization/project.


    ## Rate Limiting


    - **Per-token:** 100 requests/minute

    - **Per-IP (pre-auth):** 200 requests/minute

    - **PDF generation:** 1 request/minute per token


    Standard headers: `RateLimit-Limit`, `RateLimit-Remaining`,
    `RateLimit-Reset`


    ## Response Format


    **Success:**

    ```json

    { "success": true, "data": { ... }, "pagination": { ... } }

    ```


    **Error:**

    ```json

    { "success": false, "error": { "code": "ERROR_CODE", "message":
    "Human-readable message" } }

    ```


    ## Time windows and date filters


    There is **no global date-filter convention**. Each endpoint documents its
    own parameters:


    | Endpoint family | Parameter | Allowed values |

    |-----------------|-----------|------------------|

    | Test runs list | `start_date`, `end_date` | RFC3339 timestamps (both
    required together) |

    | Explorer, specs, analytics | `days` | Integer snapped to **7, 30, or 90**
    (see each endpoint) |

    | Test runs list | — | No preset `period` / `dateRange` params |

    | Dashboard, filters | — | **No query params** (fixed downstream snapshot) |


    ## Served by


    This contract is served by the **MCP service** (the gateway), which
    authenticates the `td_pat_`

    user PAT and fans out to data-handler / tcm / user-service / billing. It is
    **read-only** —

    webhook subscription management (the previous public API's only write
    surface) is owned by the

    **integration service** and is not part of this contract.


    ## Implementation status


    All 17 routes are mounted (auth + rate-limit). Most call their real
    downstream today; a few

    still have lean shapes or pending owners (notably `usage` → billing). Live
    vs pending detail:

    `docs/DOWNSTREAM_WORK.md`.
  contact:
    name: TestDino Support
    url: https://docs.testdino.com
servers:
  - url: https://api.testdino.com/api/v1/public
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Token Info
    description: Token introspection and project metadata
  - name: Test Runs
    description: List, inspect, and drill into test runs
  - name: Test Cases
    description: Automated test case details and history
  - name: Specs
    description: Project-level spec file health
  - name: Manual Tests
    description: Manual test suites and cases (read-only)
  - name: Test Case Explorer
    description: Aggregated test case metrics explorer
  - name: Context
    description: >-
      Debugging payload at three levels (run / suite / test) — error, steps,
      failure window, attempts, attachments, trace, deep links, and a copy-paste
      retry command. Designed for AI agents and CI scripts.
  - name: Dashboard
    description: Project health overview
  - name: Filters
    description: Available filter values (environments, branches, developers, tags)
  - name: Reports
    description: PDF report generation and download
  - name: Analytics
    description: Consolidated analytics summary and test case execution performance
  - name: Usage
    description: Subscription usage and limits
paths:
  /{projectId}/test-cases/history:
    get:
      tags:
        - Test Cases
      summary: Get execution history for a test case by title
      description: >
        Returns the execution history of a test case identified by its visible
        `title` (the name

        shown in the UI). Internally, the title is resolved to the canonical
        full title

        (`path/to/spec > describe > title`) by matching the most recently
        executed test case.

        Each entry represents one execution with its status, duration, retries,
        platform, branch,

        and associated test run counter.


        Also includes pre-computed summary metrics (execution count,
        pass/fail/flaky rates, average

        duration), unique errors encountered, and per-platform and
        per-environment breakdowns.


        Results are ordered by test run start time (newest first). Use `offset`
        and `limit` for pagination.
      parameters:
        - $ref: '#/components/parameters/projectId'
        - name: title
          in: query
          required: true
          schema:
            type: string
          description: >-
            The test case title as shown in the UI (e.g. `should display login
            form`). URL-encode if it contains special characters. If multiple
            tests share the same title, the most recently executed one is used —
            inspect `data.testCase.fullTitle` in the response to see which was
            resolved.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          description: >-
            Number of history entries to return (1–100, default 20). Upstream
            fetch limit may snap to 50, 100, 200, or 500 before client-side
            pagination.
        - name: offset
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of entries to skip (for pagination). Default 0.
      responses:
        '200':
          description: Execution history with summary and breakdown metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      testCase:
                        type: object
                        properties:
                          title:
                            type: string
                            description: Short test case title
                          fullTitle:
                            type: string
                            description: Full title including parent suites
                          specName:
                            type: string
                            description: Spec file path
                      summary:
                        type: object
                        description: Pre-computed aggregate metrics
                        properties:
                          executions:
                            type: integer
                          passedRuns:
                            type: integer
                          failedRuns:
                            type: integer
                          flakyRuns:
                            type: integer
                          skippedRuns:
                            type: integer
                          successRate:
                            type: number
                          failureRate:
                            type: number
                          flakyRate:
                            type: number
                          avgDuration:
                            type: number
                          minDuration:
                            type: number
                          maxDuration:
                            type: number
                          platforms:
                            type: array
                            items:
                              type: string
                      history:
                        type: array
                        description: Paginated list of executions (newest first)
                        items:
                          type: object
                          properties:
                            testRunId:
                              type: string
                            testCaseId:
                              type: string
                            counter:
                              type: integer
                            branch:
                              type: string
                            platform:
                              type: string
                            status:
                              type: string
                              enum:
                                - passed
                                - failed
                                - flaky
                                - skipped
                            duration:
                              type: number
                            retries:
                              type: integer
                            timestamp:
                              type: string
                              format: date-time
                            attemptsCount:
                              type: integer
                      uniqueErrors:
                        type: array
                        description: Distinct error messages encountered (max 20)
                        items:
                          type: object
                      platformMetrics:
                        type: array
                        description: Per-platform execution stats
                        items:
                          type: object
                          properties:
                            platform:
                              type: string
                            executions:
                              type: integer
                            failureCount:
                              type: integer
                            failureRate:
                              type: number
                            flakyCount:
                              type: integer
                            flakyRate:
                              type: number
                            avgDuration:
                              type: number
                      environmentMetrics:
                        type: array
                        description: Per-environment execution stats
                        items:
                          type: object
                          properties:
                            environment:
                              type: string
                            executions:
                              type: integer
                            failureRate:
                              type: number
                            flakyRate:
                              type: number
                            avgDuration:
                              type: number
        '400':
          description: Missing or invalid title parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: No test case found with the given title
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  parameters:
    projectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
      description: >-
        The project identifier (e.g. `project_abc123`). Must match the project
        associated with your PAT.
  schemas:
    ErrorEnvelope:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  responses:
    Unauthorized:
      description: Missing, invalid, expired, or revoked token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              code: AUTH_INVALID_TOKEN
              message: Invalid or expired token
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: User PAT (td_pat_) scoped to the target project

````