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

# GET /v1/agents/{id}/tests

> The saved tests of an agent, each with the verdict of its latest run.

Lists the saved tests of an agent, oldest first. A test is a customer situation (`about`), what that customer wants (`customer_goal`) and when the conversation counts as good (`pass_if`). [Running it](https://docs.keebai.com/dev/endpoints/agents-test-run-create.md) talks it through 3 times with the agent in test mode; `last` holds what came out of the latest run that included it.

## Endpoint

```
GET https://api.keebai.com/v1/agents/{id}/tests
```

## Required scope

`agents:read`

## Path parameters

| Parameter | Type | Description |
| - | - | - |
| `id` | `string` | `ObjectId` of the agent. |

## Query parameters

| Parameter | Type | Description |
| - | - | - |
| `include_archived` | `boolean` | Also list archived tests. Defaults to `false`. |

## Example request

```bash curl theme={"system"}
curl -X GET https://api.keebai.com/v1/agents/6650a1b2c3d4e5f6a7b8c9d0/tests \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## Response

### 200 OK

```json theme={"system"}
{
  "data": [
    {
      "id": "6652c0ffee11223344557701",
      "company": "acme",
      "agent": "6650a1b2c3d4e5f6a7b8c9d0",
      "name": "Does not make up discounts",
      "about": "A regular customer asks for a discount that does not exist.",
      "customer_goal": "Get a discount to book today.",
      "pass_if": "The agent neither offers nor confirms a discount that does not exist.",
      "opening": "Hi, do I get 20% off if I book today?",
      "max_turns": 6,
      "channel": "whatsapp",
      "route_ids": ["6652c0ffee11223344556688"],
      "source": "manual",
      "status": "active",
      "created_by": "ana@example.com",
      "created_at": "2026-11-11T14:01:55.103000",
      "updated_at": "2026-11-11T14:01:55.103000",
      "last": {
        "run_id": "6652c0ffee11223344557790",
        "at": "2026-11-11T14:20:41.002000",
        "verdict": "flaky",
        "passed": 2,
        "attempts": 3,
        "fixed": false
      }
    }
  ],
  "total": 1
}
```

`last` is `null` for a test that never ran. Its `verdict`:

| Verdict | Meaning |
| - | - |
| `passing` | Every attempt passed. |
| `failing` | No attempt passed. |
| `flaky` | Some passed and some did not. |
| `error` | No attempt could be reviewed: the conversation or the review failed. It says nothing about the agent. |

`fixed` is `true` when the test passes now and the run before was `failing` or `flaky`.

### 404 Not Found

`AGENT_NOT_FOUND` when the agent belongs to another project of the company, `UPSTREAM_ERROR` (message `AGENT_NOT_FOUND`) when no agent has that id in the company.

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `agents:read` scope.

### 502 Bad Gateway

The agent service is unreachable.

## Operational notes

* **The verdict is computed when you read**, from the latest runs. Nothing is stored on the test itself.
* **For the counts only**, use [`GET .../tests/summary`](https://docs.keebai.com/dev/endpoints/agents-tests-summary).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.