v3
latestOpenAPI 3.1.02026-07-311,4541,5202.3 MBDelete Testset
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.
Path parameters
Headers
Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.
Response
Successful response