{"record":{"id":"f4b246398ee1b1c6","repo":"BerriAI/litellm","slug":"user-not-found-passed-user-id-user-id","errorCode":null,"errorMessage":"User not found, passed user_id={user_id}","messagePattern":"User not found, passed user_id=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":4602,"sourceCode":"        ]\n\n    if organization_id:\n        where_conditions[\"organization_id\"] = organization_id\n    elif org_admin_org_ids is not None:\n        # Org admin: always scope to their orgs, even when filtering by user_id.\n        where_conditions[\"organization_id\"] = {\"in\": org_admin_org_ids}\n\n    if user_id:\n        try:\n            user_object_correct_type: Final = await get_user_object(\n                user_id=user_id,\n                prisma_client=prisma_client,\n                user_api_key_cache=user_api_key_cache,\n                user_id_upsert=False,\n                proxy_logging_obj=proxy_logging_obj,\n            )\n        except ValueError:\n            raise HTTPException(\n                status_code=404,\n                detail={\"error\": f\"User not found, passed user_id={user_id}\"},\n            )\n        if user_object_correct_type is None:\n            raise HTTPException(\n                status_code=404,\n                detail={\"error\": f\"User not found, passed user_id={user_id}\"},\n            )\n        user_team_ids: Final = user_object_correct_type.teams or []\n\n        if use_deleted_table:\n            where_conditions[\"members\"] = {\"has\": user_id}\n        else:\n            # When user_id is provided, filter by that user's direct team\n            # memberships. For org admins the access control gate in\n            # list_team_v2 already verified the caller's authority — the\n            # filter logic is the same as for regular users.\n            if not user_team_ids:","sourceCodeStart":4584,"sourceCodeEnd":4620,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L4584-L4620","documentation":"Error \"User not found, passed user_id={user_id}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:4602 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the passed user_id exists via /user/info before calling this endpoint."],"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"}