BerriAI/litellm · error · HTTPException

User not found, passed user_id={user_id}

Error message

User not found, passed user_id={user_id}

What it means

Error "User not found, passed user_id={user_id}" thrown in BerriAI/litellm.

Source

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

        ]

    if organization_id:
        where_conditions["organization_id"] = organization_id
    elif org_admin_org_ids is not None:
        # Org admin: always scope to their orgs, even when filtering by user_id.
        where_conditions["organization_id"] = {"in": org_admin_org_ids}

    if user_id:
        try:
            user_object_correct_type: Final = await get_user_object(
                user_id=user_id,
                prisma_client=prisma_client,
                user_api_key_cache=user_api_key_cache,
                user_id_upsert=False,
                proxy_logging_obj=proxy_logging_obj,
            )
        except ValueError:
            raise HTTPException(
                status_code=404,
                detail={"error": f"User not found, passed user_id={user_id}"},
            )
        if user_object_correct_type is None:
            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:

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify the passed user_id exists via /user/info before calling this endpoint.

When it happens

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