---
title: "Get test history"
method: GET
path: "/api/v1/user/projects/{projectId}/test-history"
tags: ["Test History"]
---

# Get test history

`GET /api/v1/user/projects/{projectId}/test-history`

## Request

- Base URL: `https://app.gaffer.sh`
- URL: `https://app.gaffer.sh/api/v1/user/projects/{projectId}/test-history`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `X-API-Key`
  - HTTP bearer

Returns pass/fail history for a specific test by name or file path.
Useful for understanding test stability over time.
Either `testName` or `filePath` must be provided.

## Path parameters

- `projectId` string, required

## Query parameters

- `testName` string
- `filePath` string
- `limit` integer

## Response `200`

Test history with summary statistics

- TestHistoryResponse
  - `history` TestHistoryEntry[], required
    - `testRunId` string, required
    - `createdAt` string, date-time, required
    - `branch` string, nullable
    - `commitSha` string, nullable
    - `test` object, required
      - `name` string, required
      - `status` 'passed' | 'failed' | 'skipped' | 'pending', required
      - `durationMs` number, required
      - `filePath` string, nullable
      - `message` string, nullable
  - `summary` object, required
    - `totalRuns` integer, required
    - `passedRuns` integer, required
    - `failedRuns` integer, required
    - `passRate` number, nullable: Pass rate as percentage (0-100)
    - `searchedBy` 'testName' | 'filePath', required
    - `searchValue` string, required
  - `message` string, nullable: Human-readable message when no results are found
  - `meta` Meta, nullable: Present when query parameters were clamped by plan tier limits. Only included in the response when clamping actually occurred.
    - `appliedDays` integer: The actual days value used after clamping
    - `requestedDays` integer: The days value originally requested
    - `appliedLimit` integer: The actual limit value used after clamping
    - `requestedLimit` integer: The limit value originally requested
    - `clampedByPlan` boolean: Always true when this object is present

## Other responses

- `400`: Invalid request parameters
- `401`: Missing or invalid API key
- `404`: Resource not found

---

[API](https://skmtc.dev/gaffer/apis/gaffer-api.md) · [All operations](https://skmtc.dev/gaffer/apis/gaffer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gaffer/apis/gaffer-api/revisions/d742ab303118?raw)
