{"record":{"id":"663b3296e911645d","repo":"BerriAI/litellm","slug":"user-id-doesn-t-exist-in-team-table-data-data","errorCode":null,"errorMessage":"User id doesn't exist in team table. Data={data}","messagePattern":"User id doesn't exist in team table\\. Data=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":3431,"sourceCode":"        team_id=data.team_id,\n        key_limit=None,\n        user_api_key_dict=user_api_key_dict,\n    )\n\n    team_table: Final = returned_team_info[\"team_info\"]\n\n    ## get user id\n    received_user_id: str | None = None\n    if data.user_id is not None:\n        received_user_id = data.user_id\n    elif data.user_email is not None:\n        for member in returned_team_info[\"team_info\"].members_with_roles:\n            if member.user_email is not None and member.user_email == data.user_email:\n                received_user_id = member.user_id\n                break\n\n    if received_user_id is None:\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": f\"User id doesn't exist in team table. Data={data}\"},\n        )\n    ## find the relevant team membership\n    identified_budget_id: str | None = None\n    for tm in returned_team_info[\"team_memberships\"]:\n        if tm.user_id == received_user_id:\n            identified_budget_id = tm.budget_id\n            break\n\n    # If this membership still points at the team's shared default member\n    # budget, _upsert_budget_and_membership will clone-on-write so that the\n    # update only touches this user (not every member sharing the default).\n    team_default_budget_id: str | None = None\n    if team_table.metadata is not None:\n        raw_default_budget_id: Final = team_table.metadata.get(\"team_member_budget_id\")\n        if isinstance(raw_default_budget_id, str):\n            team_default_budget_id = raw_default_budget_id","sourceCodeStart":3413,"sourceCodeEnd":3449,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L3413-L3449","documentation":"Error \"User id doesn't exist in team table. Data={data}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:3431 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the user_id exists and is a member of the team; check the request data shown in the error."],"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"}