BerriAI/litellm · error · HTTPException

Cannot move team to organization. Team has user_id {not_in_o

Error message

Cannot move team to organization. Team has user_id {not_in_org} that is not a member of the organization.

What it means

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.

Source

Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1830

    ):
        raise HTTPException(
            status_code=403,
            detail={
                "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}."
            },
        )

    # For non-proxy-admins, require all team members to already be org members.
    # This prevents a team admin from moving their team into an arbitrary org and
    # thereby injecting members into that org without org admin approval.
    if not is_proxy_admin:
        team_members: Final = [m.user_id for m in team.members_with_roles]
        org_members: Final = [m.user_id for m in organization.members] if organization.members else []
        not_in_org: Final = [
            m for m in team_members if m not in org_members and m != SpecialProxyStrings.default_user_id.value
        ]
        if len(not_in_org) > 0:
            raise HTTPException(
                status_code=403,
                detail={
                    "error": f"Cannot move team to organization. Team has user_id {not_in_org} that is not a member of the organization."
                },
            )

    # Check if the team's tpm/rpm limit is less than the org's tpm/rpm limit
    if (
        team.tpm_limit
        and organization.litellm_budget_table
        and organization.litellm_budget_table.tpm_limit
        and team.tpm_limit > organization.litellm_budget_table.tpm_limit
    ):
        raise HTTPException(
            status_code=403,
            detail={
                "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}."
            },

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Add the team's users to the organization before moving the team.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1830 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/3ab4c06298b62935. Report an issue: GitHub.