{"record":{"id":"baef12212b2086c1","repo":"BerriAI/litellm","slug":"update-fields-must-specify-at-least-one-field-to-u","errorCode":null,"errorMessage":"update_fields must specify at least one field to update.","messagePattern":"update_fields must specify at least one field to update\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/types/proxy/management_endpoints/key_management_endpoints.py","lineNumber":89,"sourceCode":"    # Expiry\n    duration: str | None = None\n\n    # Operational metadata\n    tags: list[str] | None = None\n    metadata: dict[str, Any] | None = None\n\n    @model_validator(mode=\"after\")\n    def validate_temp_budget(self) -> \"KeyUpdateFields\":\n        if self.temp_budget_increase is not None or self.temp_budget_expiry is not None:\n            if self.temp_budget_increase is None or self.temp_budget_expiry is None:\n                raise ValueError(\"temp_budget_increase and temp_budget_expiry must be set together\")\n        return self\n\n    @model_validator(mode=\"after\")\n    def require_at_least_one_field(self) -> \"KeyUpdateFields\":\n        # 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`.\")","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/types/proxy/management_endpoints/key_management_endpoints.py#L71-L107","documentation":"Model validator on KeyUpdateFields: model_fields_set is empty, meaning the update payload contained no actual fields, which would iterate keys performing no-op writes. At least one updatable field must be present in update_fields.","triggerScenarios":"Thrown at litellm/types/proxy/management_endpoints/key_management_endpoints.py:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include at least one field in update_fields describing what to update."],"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"}