{"record":{"id":"0e3573e4bdc2861b","repo":"BerriAI/litellm","slug":"must-specify-either-users-for-individual-updates-0e3573","errorCode":null,"errorMessage":"Must specify either 'users' for individual updates or 'all_users=True' with 'user_updates' for bulk updates","messagePattern":"Must specify either 'users' for individual updates or 'all_users=True' with 'user_updates' for bulk updates","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/types/proxy/management_endpoints/internal_user_endpoints.py","lineNumber":45,"sourceCode":"    users: list[UpdateUserRequest] | None = None  # List of specific user update requests\n    all_users: bool | None = False  # Flag to update all users\n    user_updates: UpdateUserRequestNoUserIDorEmail | None = None  # Updates to apply to all users when all_users=True\n\n    @field_validator(\"users\", \"all_users\", \"user_updates\")\n    @classmethod\n    def validate_request(cls, v, info):\n        # Get all field values for validation\n        values: Final = info.data if hasattr(info, \"data\") else {}\n\n        # After all fields are set, validate the combination\n        if info.field_name == \"user_updates\":  # This is the last field, do validation here\n            users: Final = values.get(\"users\")\n            all_users: Final = values.get(\"all_users\", False)\n            user_updates: Final = v\n\n            # Must specify either users list OR all_users with user_updates\n            if not users and not (all_users and user_updates):\n                raise ValueError(\n                    \"Must specify either 'users' for individual updates or 'all_users=True' with 'user_updates' for bulk updates\"\n                )\n\n            # Cannot specify both users list and all_users\n            if users and all_users:\n                raise ValueError(\"Cannot specify both 'users' and 'all_users=True'. Choose one approach.\")\n\n        return v\n\n\nclass UserUpdateResult(BaseModel):\n    \"\"\"Result of a single user update operation\"\"\"\n\n    user_id: str | None = None\n    user_email: str | None = None\n    success: bool\n    error: str | None = None\n    updated_user: dict[str, Any] | None = None","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/types/proxy/management_endpoints/internal_user_endpoints.py#L27-L63","documentation":"Cross-field validator on the bulk user-update request: neither a 'users' list nor the combination all_users=True with user_updates was provided, so the update has no target. Exactly one targeting approach must be chosen.","triggerScenarios":"Thrown at litellm/types/proxy/management_endpoints/internal_user_endpoints.py:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Either pass 'users' for individual updates, or set all_users=True together with 'user_updates' for bulk updates."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}