v3

latestOpenAPI 3.1.02026-07-311,4541,5202.3 MB
experiments

Api Testsets List

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.

get/api/testsets/

Query parameters

pageinteger

A page number within the paginated result set.

page_sizeinteger

Number of results to return per page.

Headers

Authorizationstring required

JWT access token or Respan API key

Response

countinteger required
nextstring uri nullable
previousstring uri nullable
total_countinteger
current_filtersFilterParamDictPydantic

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_dataPaginatedTestsetSheetListListFiltersData