---
title: "Query Testcases"
method: POST
path: "/preview/testcases/query"
tags: ["Testcases"]
---

# Query Testcases

`POST /preview/testcases/query`

## Request body

- TestcasesQueryRequest
  - `testcase_ids` string[], nullable
  - `testset_id` string, uuid, nullable
  - `testset_revision_id` string, uuid, nullable
  - `windowing` Windowing
    - `newest` string, date-time, nullable
    - `oldest` string, date-time, nullable
    - `next` string, uuid, nullable
    - `limit` integer, nullable
    - `order` 'ascending' | 'descending', nullable
    - `interval` integer, nullable
    - `rate` number, nullable

## Response `200`

Successful Response

- TestcasesResponse
  - `count` integer
  - `testcases` TestcaseOutput[]
    - `testset_id` string, uuid, nullable
    - `set_id` string, uuid, nullable
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
    - `deleted_at` string, date-time, nullable
    - `created_by_id` string, uuid, nullable
    - `updated_by_id` string, uuid, nullable
    - `deleted_by_id` string, uuid, nullable
    - `id` string, uuid, nullable
    - `flags` object, nullable
    - `tags` object, nullable
    - `meta` object, nullable
    - `data` object, nullable
  - `windowing` Windowing
    - `newest` string, date-time, nullable
    - `oldest` string, date-time, nullable
    - `next` string, uuid, nullable
    - `limit` integer, nullable
    - `order` 'ascending' | 'descending', nullable
    - `interval` integer, nullable
    - `rate` number, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-02-13** `72fe88316d15` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2026-01-14** `53da4c9de2b7` — 1 breaking, 3 info
  - response property `testcases/items/flags/anyOf[subschema #1]/additionalProperties/` list-of-types was widened by adding types `object` to media type `application/json` of response `200`
  - added the new optional request property `testset_revision_id`
  - added the optional property `windowing` to the response with the `200` status
  - response property `testcases/items/tags/anyOf[subschema #1]/additionalProperties/` list-of-types was narrowed by removing types `integer, null and number` from media type `application/json` of response `200`
- **2025-11-05** `e62506c24377` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/preview/testcases/query/post.md)

---

[API](https://skmtc.dev/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.dev/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/revisions/72fe88316d15/schema)
