{"record":{"id":"d6f9cc0a1decaf57","repo":"BerriAI/litellm","slug":"group-not-found-with-id-team-id","errorCode":null,"errorMessage":"Group not found with ID: {team_id}","messagePattern":"Group not found with ID: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/scim/scim_v2.py","lineNumber":281,"sourceCode":"    \"\"\"Check if user exists and return user, raise 404 if not found.\"\"\"\n    prisma_client: Final = await _get_prisma_client_or_raise_exception()\n\n    user: Final = await _table(UserRepository(prisma_client)).find_unique(where={\"user_id\": user_id})\n\n    if not user:\n        raise HTTPException(status_code=404, detail={\"error\": f\"User not found with ID: {user_id}\"})\n\n    return user\n\n\nasync def _check_team_exists(team_id: str) -> LiteLLM_TeamTable:\n    \"\"\"Check if team exists and return team, raise 404 if not found.\"\"\"\n    prisma_client: Final = await _get_prisma_client_or_raise_exception()\n\n    team: Final = await _table(TeamRepository(prisma_client)).find_unique(where={\"team_id\": team_id})\n\n    if not team:\n        raise HTTPException(status_code=404, detail={\"error\": f\"Group not found with ID: {team_id}\"})\n\n    return team\n\n\ndef _extract_scim_user_data(user: SCIMUser) -> ScimUserData:\n    \"\"\"Extract common data from SCIMUser object.\"\"\"\n    user_email = None\n    if user.emails and len(user.emails) > 0:\n        user_email = user.emails[0].value\n\n    user_alias = None\n    if user.name and user.name.givenName:\n        user_alias = user.name.givenName\n\n    teams = []\n    if user.groups:\n        teams = [group.value for group in user.groups]\n","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/scim/scim_v2.py#L263-L299","documentation":"_check_team_exists looks up the team (SCIM group) by team_id and receives None: the group id in the SCIM request has no matching LiteLLM_TeamTable row. Raised as 404 for RFC-compliant not-found behavior.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/scim/scim_v2.py:281 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the group ID. List groups via GET /Groups to find valid IDs."],"exampleFix":null,"handlingStrategy":"validation","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"}