---
title: "Query Testsets"
method: POST
path: "/preview/testsets/query"
tags: ["Testsets"]
---

# Query Testsets

`POST /preview/testsets/query`

## Request body

- TestsetQueryRequest
  - `testset` TestsetQuery
    - `flags` TestsetFlags
      - `has_testcases` boolean, nullable
      - `has_traces` boolean, nullable
    - `tags` object, nullable
    - `meta` object, nullable
    - `name` string, nullable
    - `description` string, nullable
  - `testset_refs` AgentaSdkModelsSharedReference[], nullable
    - `version` string, nullable
    - `slug` string, nullable
    - `id` string, uuid, nullable
  - `include_archived` boolean, 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

- TestsetsResponse
  - `count` integer
  - `testsets` Testset[]
    - `flags` TestsetFlags
      - `has_testcases` boolean, nullable
      - `has_traces` boolean, nullable
    - `tags` object, nullable
    - `meta` object, nullable
    - `name` string, nullable
    - `description` string, 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
    - `slug` string, nullable
    - `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

## Other responses

- `422` — Validation Error

## Changes

- **2026-01-14** `53da4c9de2b7` — 1 breaking, 2 info
  - request property `testset/anyOf[subschema #1: TestsetQuery]/tags/anyOf[subschema #1]/additionalProperties/` list-of-types was narrowed by removing types `integer, null and number` from media type `application/json`
  - added the optional property `windowing` to the response with the `200` status
  - response property `testsets/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` — 4 breaking, 2 warning, 8 info
  - removed `#/components/schemas/TagsRequest, subschema #2` from the request body `anyOf` list
  - request body became required
  - the request's body type changed from no type to `object`
  - the response property `count` became optional for the status `200`
  - …10 more
- **2025-06-27** `e3e84db47198` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/preview/testsets/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.dev/agenta-ai/apis/agenta-api/revisions/53da4c9de2b7?raw)
