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

# Query Testsets

`POST /preview/testsets/query`

## Request body

- TestsetQueryRequest
  - `testset` TestsetQuery
    - `folder_id` string, uuid, nullable
    - `flags` TestsetFlags — Placeholder for testset-level flags. This model is intentionally empty but kept as a dedicated type so that: - existing references to `flags: Optional[TestsetFlags]` remain valid, and - structured flags can be added here in the future without breaking the surrounding DTOs.
    - `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[]
    - `folder_id` string, uuid, nullable
    - `flags` TestsetFlags — Placeholder for testset-level flags. This model is intentionally empty but kept as a dedicated type so that: - existing references to `flags: Optional[TestsetFlags]` remain valid, and - structured flags can be added here in the future without breaking the surrounding DTOs.
    - `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-02-13** `72fe88316d15` — 4 warning, 4 info
  - removed the request property `testset/anyOf[subschema #1: TestsetQuery]/flags/anyOf[subschema #1: TestsetFlags]/has_testcases`
  - removed the request property `testset/anyOf[subschema #1: TestsetQuery]/flags/anyOf[subschema #1: TestsetFlags]/has_traces`
  - removed the optional property `testsets/items/flags/anyOf[subschema #1: TestsetFlags]/has_testcases` from the response with the `200` status
  - removed the optional property `testsets/items/flags/anyOf[subschema #1: TestsetFlags]/has_traces` from the response with the `200` status
  - …4 more
- **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`
- …earlier changes not shown

[Full 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-service-production.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/revisions/72fe88316d15/schema)
