{"record":{"id":"59d3c24625820e0b","repo":"BerriAI/litellm","slug":"multiple-users-found-with-email-member-user-emai","errorCode":null,"errorMessage":"Multiple users found with email '{member.user_email}'. Please use 'user_id' instead.","messagePattern":"Multiple users found with email '(.+?)'\\. Please use 'user_id' instead\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":2943,"sourceCode":"            detail={\"error\": \"Either user_id or user_email must be provided\"},\n        )\n\n    # Case 1: Both user_email and user_id provided - verify they match\n    if member.user_email is not None and member.user_id is not None:\n        # Use user_email as source of truth\n        # Check for multiple users with same email first\n        users_by_email = await prisma_client.get_data(\n            key_val={\"user_email\": member.user_email},\n            table_name=\"user\",\n            query_type=\"find_all\",\n        )\n\n        if users_by_email is None or (isinstance(users_by_email, list) and len(users_by_email) == 0):\n            # User doesn't exist yet - this is fine, will be created later\n            return member\n\n        if isinstance(users_by_email, list) and len(users_by_email) > 1:\n            raise HTTPException(\n                status_code=400,\n                detail={\n                    \"error\": f\"Multiple users found with email '{member.user_email}'. Please use 'user_id' instead.\"\n                },\n            )\n\n        # Get the single user\n        user_by_email = users_by_email[0]\n\n        # Verify the user_id matches\n        if user_by_email.user_id != member.user_id:\n            raise HTTPException(\n                status_code=400,\n                detail={\n                    \"error\": f\"user_email '{member.user_email}' and user_id '{member.user_id}' do not belong to the same user.\"\n                },\n            )\n","sourceCodeStart":2925,"sourceCodeEnd":2961,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L2925-L2961","documentation":"Error \"Multiple users found with email '{member.user_email}'. Please use 'user_id' instead.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:2943 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use user_id instead of user_email to disambiguate between multiple users with that email."],"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"}