BerriAI/litellm · error · HTTPException

User is not a member of team_id={team_id}

Error message

User is not a member of team_id={team_id}

What it means

Error "User is not a member of team_id={team_id}" thrown in BerriAI/litellm.

Source

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

            raise HTTPException(
                status_code=404,
                detail={"error": f"User not found, passed user_id={user_id}"},
            )
        user_team_ids: Final = user_object_correct_type.teams or []

        if use_deleted_table:
            where_conditions["members"] = {"has": user_id}
        else:
            # When user_id is provided, filter by that user's direct team
            # memberships. For org admins the access control gate in
            # list_team_v2 already verified the caller's authority — the
            # filter logic is the same as for regular users.
            if not user_team_ids:
                return None  # no memberships — skip the DB query
            elif team_id is not None:
                # team_id exact-match already in where_conditions; verify membership
                if team_id not in user_team_ids:
                    raise HTTPException(
                        status_code=404,
                        detail={"error": f"User is not a member of team_id={team_id}"},
                    )
            else:
                where_conditions["team_id"] = {"in": user_team_ids}

    return where_conditions


async def _batch_resolve_access_group_resources(
    all_access_group_ids: list[str],
) -> dict[str, LiteLLM_AccessGroupTable]:
    """
    Batch-fetch access groups in a single DB query and return them keyed by
    access_group_id. Missing/invalid groups are silently omitted.
    """
    from litellm.proxy.proxy_server import prisma_client as _prisma_client

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Add the user to the team first via /team/member_add, or verify the team_id.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/team_endpoints.py:4625 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/92651203f4cc383e. Report an issue: GitHub.