{"record":{"id":"3ab4c06298b62935","repo":"BerriAI/litellm","slug":"cannot-move-team-to-organization-team-has-user-id","errorCode":null,"errorMessage":"Cannot move team to organization. Team has user_id {not_in_org} that is not a member of the organization.","messagePattern":"Cannot move team to organization\\. Team has user_id (.+?) that is not a member of the organization\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":1830,"sourceCode":"    ):\n        raise HTTPException(\n            status_code=403,\n            detail={\n                \"error\": f\"Cannot move team to organization. Team has max_budget {team.max_budget} that is greater than the organization's max_budget {organization.litellm_budget_table.max_budget}.\"\n            },\n        )\n\n    # For non-proxy-admins, require all team members to already be org members.\n    # This prevents a team admin from moving their team into an arbitrary org and\n    # thereby injecting members into that org without org admin approval.\n    if not is_proxy_admin:\n        team_members: Final = [m.user_id for m in team.members_with_roles]\n        org_members: Final = [m.user_id for m in organization.members] if organization.members else []\n        not_in_org: Final = [\n            m for m in team_members if m not in org_members and m != SpecialProxyStrings.default_user_id.value\n        ]\n        if len(not_in_org) > 0:\n            raise HTTPException(\n                status_code=403,\n                detail={\n                    \"error\": f\"Cannot move team to organization. Team has user_id {not_in_org} that is not a member of the organization.\"\n                },\n            )\n\n    # Check if the team's tpm/rpm limit is less than the org's tpm/rpm limit\n    if (\n        team.tpm_limit\n        and organization.litellm_budget_table\n        and organization.litellm_budget_table.tpm_limit\n        and team.tpm_limit > organization.litellm_budget_table.tpm_limit\n    ):\n        raise HTTPException(\n            status_code=403,\n            detail={\n                \"error\": f\"Cannot move team to organization. Team has tpm_limit {team.tpm_limit} that is greater than the organization's tpm_limit {organization.litellm_budget_table.tpm_limit}.\"\n            },","sourceCodeStart":1812,"sourceCodeEnd":1848,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L1812-L1848","documentation":"Error \"Cannot move team to organization. Team has user_id {not_in_org} that is not a member of the organization.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1830 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the team's users to the organization before moving the team."],"exampleFix":null,"handlingStrategy":null,"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"}