{"record":{"id":"d00eb9c91e22c4fe","repo":"BerriAI/litellm","slug":"provide-either-key-ids-or-all-keys-in-team-true","errorCode":null,"errorMessage":"Provide either `key_ids` or `all_keys_in_team=True`, not both.","messagePattern":"Provide either `key_ids` or `all_keys_in_team=True`, not both\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/types/proxy/management_endpoints/key_management_endpoints.py","lineNumber":105,"sourceCode":"        # Reject empty payload — would iterate every key with no-op writes.\n        if not self.model_fields_set:\n            raise ValueError(\"update_fields must specify at least one field to update.\")\n        return self\n\n\nclass BulkUpdateTeamKeysRequest(BaseModel):\n    \"\"\"Apply one update payload to many keys inside a team; provide either `key_ids` or `all_keys_in_team=True`.\"\"\"\n\n    team_id: str\n    key_ids: list[str] | None = None\n    all_keys_in_team: bool = False\n    update_fields: KeyUpdateFields\n\n    @model_validator(mode=\"after\")\n    def validate_selection(self) -> \"BulkUpdateTeamKeysRequest\":\n        has_key_ids: Final = self.key_ids is not None and len(self.key_ids) > 0\n        if has_key_ids and self.all_keys_in_team:\n            raise ValueError(\"Provide either `key_ids` or `all_keys_in_team=True`, not both.\")\n        if not has_key_ids and not self.all_keys_in_team:\n            raise ValueError(\"Must provide either `key_ids` (non-empty) or `all_keys_in_team=True`.\")\n        return self\n","sourceCodeStart":87,"sourceCodeEnd":109,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/types/proxy/management_endpoints/key_management_endpoints.py#L87-L109","documentation":"Model validator on BulkUpdateTeamKeysRequest: both key_ids and all_keys_in_team=True were provided. The endpoint requires exactly one selection mode — an explicit key list or the whole team — never both.","triggerScenarios":"Thrown at litellm/types/proxy/management_endpoints/key_management_endpoints.py:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass either key_ids or all_keys_in_team=True, not both together."],"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"}