{"record":{"id":"7abcb21e2a19b464","repo":"BerriAI/litellm","slug":"invalid-role-must-be-one-of-role-value-for-rol","errorCode":null,"errorMessage":"Invalid role. Must be one of: {[role.value for role in ROLES_WITHIN_ORG]}","messagePattern":"Invalid role\\. Must be one of: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/_types.py","lineNumber":4002,"sourceCode":"class OrganizationMemberDeleteRequest(MemberDeleteRequest):\n    organization_id: str\n\n\nROLES_WITHIN_ORG: Final = [\n    LitellmUserRoles.ORG_ADMIN,\n    LitellmUserRoles.INTERNAL_USER,\n    LitellmUserRoles.INTERNAL_USER_VIEW_ONLY,\n]\n\n\nclass OrganizationMemberUpdateRequest(OrganizationMemberDeleteRequest):\n    max_budget_in_organization: float | None = None\n    role: LitellmUserRoles | None = None\n\n    @field_validator(\"role\")\n    def validate_role(cls, value: LitellmUserRoles | None) -> LitellmUserRoles | None:\n        if value is not None and value not in ROLES_WITHIN_ORG:\n            raise ValueError(f\"Invalid role. Must be one of: {[role.value for role in ROLES_WITHIN_ORG]}\")\n        return value\n\n\nclass OrganizationMemberUpdateResponse(MemberUpdateResponse):\n    organization_id: str\n    max_budget_in_organization: float\n\n\n##########################################\n\n\nclass TeamAccessGroupModelGrant(LiteLLMPydanticObjectBase):\n    access_group_id: str\n    access_group_name: str\n    models: tuple[str, ...]\n\n\nclass TeamInfoResponseObjectTeamTable(LiteLLM_TeamTable):","sourceCodeStart":3984,"sourceCodeEnd":4020,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_types.py#L3984-L4020","documentation":"Field validator on OrganizationMemberUpdateRequest.role: the requested role is not one of the org-scoped roles (org_admin, internal_user, internal_user_view_only), preventing escalation to proxy-level roles inside an org membership.","triggerScenarios":"Thrown at litellm/proxy/_types.py:4002 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the listed valid org roles."],"exampleFix":"role='org_admin'","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"}