{"record":{"id":"d495796bee90eaa7","repo":"BerriAI/litellm","slug":"user-email-member-user-email-and-user-id-mem","errorCode":null,"errorMessage":"user_email '{member.user_email}' and user_id '{member.user_id}' do not belong to the same user.","messagePattern":"user_email '(.+?)' and user_id '(.+?)' do not belong to the same user\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":2955,"sourceCode":"\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\n        # Both match, return as is\n        return member\n\n    # Case 2: Only user_email provided - populate user_id from DB\n    if member.user_email is not None and member.user_id is None:\n        user_by_email = await _user_db(prisma_client).find_first(\n            where={\"user_email\": {\"equals\": member.user_email, \"mode\": \"insensitive\"}}\n        )\n\n        if user_by_email is None:\n            # User doesn't exist yet - this is fine, will be created later\n            return member","sourceCodeStart":2937,"sourceCodeEnd":2973,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L2937-L2973","documentation":"Error \"user_email '{member.user_email}' and user_id '{member.user_id}' do not belong to the same user.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:2955 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only the correct user_id or user_email; the two given identifiers refer to different users."],"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"}