From e8f749c42467fb8314a6c7702c56de617b0c1387 Mon Sep 17 00:00:00 2001 From: mubashir1osmani Date: Thu, 16 Jul 2026 19:35:20 -0700 Subject: [PATCH] fix(proxy/team): return 400 not 422 when bulk member update exceeds the 500-user cap BulkTeamMemberUpdateRequest carried Field(max_length=500) on user_ids, so an over-cap batch was rejected by FastAPI request-body validation with 422 before the handler ran. The handler already enforces the same cap with an explicit 400, and it is the only check that also covers the all_members_in_team=True path, where user_ids is built from the team and the Field constraint cannot apply. Drop the redundant Field constraint so the handler is the single source of truth and both paths return 400. --- litellm/proxy/_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 366ecb4c69d..e80e2fa36a6 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -3759,7 +3759,7 @@ class TeamMemberBulkUpdateFields(LiteLLMPydanticObjectBase): class BulkTeamMemberUpdateRequest(LiteLLMPydanticObjectBase): - user_ids: list[str] | None = Field(default=None, max_length=BULK_TEAM_MEMBER_UPDATE_MAX_USER_IDS) + user_ids: list[str] | None = Field(default=None) all_members_in_team: bool = False update_fields: TeamMemberBulkUpdateFields