---
title: "Api Testsets List"
method: GET
path: "/api/testsets/"
tags: ["experiments"]
---

# Api Testsets List

`GET /api/testsets/`

Mixin that provides automatic organization injection and cross-org write protection.

This mixin handles ALL organization-related write behavior:
- CREATE: Injects organization (user's org for JWT, target org for API key superadmin)
- UPDATE/DELETE: Allows same-org writes; cross-org JWT writes require the
  caller's scope-aware ``is_superadmin()`` (active staff write scope). API
  key superadmin can write anywhere.

This is DATA SANITIZATION, not permission. Permission classes handle authentication
and authorization (can they write at all?). This mixin handles where they write to.

Inherits from:
- JWTAuthUtils: is_jwt_auth(), is_jwt_token_format()
- PermissionUtils: is_read_operation(), is_write_operation(), is_same_org()
- OrgScopeMixin: is_superadmin(), get_organization(), inject_*_organization()

Behavior:
    - post(): Calls inject_target_organization() for CREATE operations
    - patch()/put(): Calls inject_user_organization() for UPDATE operations
    - perform_update(): Allows cross-org UPDATE for JWT auth only with active staff write scope
    - perform_destroy(): Allows cross-org DELETE for JWT auth only with active staff write scope

Usage:
    class MyView(OrganizationInjectionMixin, JWTAndAPIKeyAuthenticationViewMixin, ListCreateAPIView):
        # All org injection and cross-org protection automatic!
        pass

Note: SuperAdminMixin inherits from this mixin, so views using SuperAdminMixin
automatically get these safe defaults.

## Query parameters

- `page` integer
- `page_size` integer

## Headers

- `Authorization` string, required

## Response `200`

- PaginatedTestsetSheetListList
  - `count` integer, required
  - `next` string, uri, nullable
  - `previous` string, uri, nullable
  - `total_count` integer
  - `current_filters` FilterParamDictPydantic — Pydantic model for FilterParamDict. A dictionary that maps metric names to their filter parameters. Each key is a metric name (str), and each value can be: - A single MetricFilterParamPydantic (one condition) - A List[MetricFilterParamPydantic] (multiple conditions for same metric) - A FilterBundlePydantic (nested filter bundle with connector) Note: Uses extra="allow" for dynamic metric name fields. The __pydantic_extra__ annotation tells Pydantic what types to expect for extra fields, and generates typed additionalProperties in JSON Schema.
  - `filters_data` PaginatedTestsetSheetListListFiltersData
  - `results` TestsetSheetList[], required
    - `testset_unique_id` string
    - `updated_by` Editor, required
      - `id` integer, required
      - `email` string, required
      - `name` string, required
      - `username` string
      - `first_name` string
      - `last_name` string
    - `tags` GenericTagDisplay[], required
      - `id` string, required
      - `name` string, required
      - `color` string, required
      - `created_at` string, date-time, required
      - `updated_at` string, date-time, required
    - `project` string, nullable
    - `created_at` string, date-time
    - `name` string, required
    - `description` string
    - `updated_at` string, date-time
    - `row_count` integer
    - `column_count` integer
    - `max_insertions_before_rebalance` integer
    - `used_row_indexes` number[]
    - `current_max_row_index` number, double
    - `column_definitions` unknown[]
      - unknown
    - `starred` boolean
    - `created_by` integer, nullable
    - `organization` integer, required

---

[API](https://skmtc.net/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.net/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keywordsai/api-reference/versions/c26d550029f8/schema)
