{"record":{"id":"c5b671c7927706c3","repo":"BerriAI/litellm","slug":"cannot-specify-both-users-and-all-users-true","errorCode":null,"errorMessage":"Cannot specify both 'users' and 'all_users=True'. Choose one approach.","messagePattern":"Cannot specify both 'users' and 'all_users=True'\\. Choose one approach\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/types/proxy/management_endpoints/internal_user_endpoints.py","lineNumber":51,"sourceCode":"    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\n\n\nclass BulkUpdateUserResponse(BaseModel):\n    \"\"\"Response for bulk user update operations\"\"\"\n\n    results: list[UserUpdateResult]","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/types/proxy/management_endpoints/internal_user_endpoints.py#L33-L69","documentation":"Cross-field validator on the bulk user-update request: both an explicit 'users' list and all_users=True were supplied at once. These are mutually exclusive targeting modes; remove one before retrying.","triggerScenarios":"Thrown at litellm/types/proxy/management_endpoints/internal_user_endpoints.py:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose one approach: 'users' list OR all_users=True with user_updates, not both."],"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-14T00:17:10.932Z"}