BerriAI/litellm · error · HTTPException

Available-team self-join can only add the caller (user_id mu

Error message

Available-team self-join can only add the caller (user_id must match the authenticated user's user_id).

What it means

Error "Available-team self-join can only add the caller (user_id must match the authenticated user's user_id)." thrown in BerriAI/litellm.

Source

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

    # Available-team self-join: caller may add only themselves, only as a
    # standard user.  Enforce that here so the bypass cannot be used as a
    # privilege-escalation or cross-user-injection primitive.
    members: Final = data.member if isinstance(data.member, list) else [data.member]
    caller_user_id: Final = getattr(user_api_key_dict, "user_id", None)
    for member in members:
        if getattr(member, "role", "user") != "user":
            raise HTTPException(
                status_code=403,
                detail={
                    "error": (
                        "Available-team self-join cannot assign 'admin' role. "
                        "Only proxy/team/org admins can add admins to a team."
                    )
                },
            )
        member_user_id = getattr(member, "user_id", None)
        if not caller_user_id or not member_user_id or member_user_id != caller_user_id:
            raise HTTPException(
                status_code=403,
                detail={
                    "error": (
                        "Available-team self-join can only add the caller "
                        "(user_id must match the authenticated user's user_id)."
                    )
                },
            )


async def _process_team_members(
    data: TeamMemberAddRequest,
    complete_team_data: LiteLLM_TeamTable,
    prisma_client: PrismaClient,
    user_api_key_dict: UserAPIKeyAuth,
    litellm_proxy_admin_name: str,
) -> tuple[list[LiteLLM_UserTable], list[LiteLLM_TeamMembership]]:
    """Process and add new team members."""

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Set member user_id to your own authenticated user_id when self-joining an available team.

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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