{"record":{"id":"02fcee5044a8f2dd","repo":"BerriAI/litellm","slug":"either-user-id-or-user-email-must-be-provided-02fcee","errorCode":null,"errorMessage":"Either user id or user email must be provided","messagePattern":"Either user id or user email must be provided","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/_types.py","lineNumber":1709,"sourceCode":"            LitellmUserRoles.INTERNAL_USER,\n            LitellmUserRoles.INTERNAL_USER_VIEW_ONLY,\n        ]\n        | None\n    ) = None\n    max_budget: float | None = None\n\n\nclass UpdateUserRequest(UpdateUserRequestNoUserIDorEmail):\n    # Note: the defaults of all Params here MUST BE NONE\n    # else they will get overwritten\n    user_id: str | None = None\n    user_email: str | None = None\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def check_user_info(cls, values):\n        if values.get(\"user_id\") is None and values.get(\"user_email\") is None:\n            raise ValueError(\"Either user id or user email must be provided\")\n        return values\n\n\nclass DeleteUserRequest(LiteLLMPydanticObjectBase):\n    user_ids: list[str]  # required\n\n\nAllowedModelRegion = Literal[\"eu\", \"us\"]\n\n\nclass BudgetNewRequest(LiteLLMPydanticObjectBase):\n    budget_id: str | None = Field(default=None, description=\"The unique budget id.\")\n    max_budget: float | None = Field(\n        default=None,\n        description=\"Requests will fail if this budget (in USD) is exceeded.\",\n    )\n    soft_budget: float | None = Field(\n        default=None,","sourceCodeStart":1691,"sourceCodeEnd":1727,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_types.py#L1691-L1727","documentation":"Pydantic model_validator on UpdateUserRequest (mirroring the team-member validator) rejecting a user update that identifies no target: both user_id and user_email are None. Because non-None field defaults on this model overwrite existing values, applying an unidentified update would be both a no-op and dangerous, so validation fails before any DB write.","triggerScenarios":"Thrown at litellm/proxy/_types.py:1709 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide user_id or user_email in the request."],"exampleFix":"user_id='user-123'","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"}