{"record":{"id":"92651203f4cc383e","repo":"BerriAI/litellm","slug":"user-is-not-a-member-of-team-id-team-id","errorCode":null,"errorMessage":"User is not a member of team_id={team_id}","messagePattern":"User is not a member of team_id=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":4625,"sourceCode":"            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:\n                return None  # no memberships — skip the DB query\n            elif team_id is not None:\n                # team_id exact-match already in where_conditions; verify membership\n                if team_id not in user_team_ids:\n                    raise HTTPException(\n                        status_code=404,\n                        detail={\"error\": f\"User is not a member of team_id={team_id}\"},\n                    )\n            else:\n                where_conditions[\"team_id\"] = {\"in\": user_team_ids}\n\n    return where_conditions\n\n\nasync def _batch_resolve_access_group_resources(\n    all_access_group_ids: list[str],\n) -> dict[str, LiteLLM_AccessGroupTable]:\n    \"\"\"\n    Batch-fetch access groups in a single DB query and return them keyed by\n    access_group_id. Missing/invalid groups are silently omitted.\n    \"\"\"\n    from litellm.proxy.proxy_server import prisma_client as _prisma_client\n","sourceCodeStart":4607,"sourceCodeEnd":4643,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L4607-L4643","documentation":"Error \"User is not a member of team_id={team_id}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:4625 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the user to the team first via /team/member_add, or verify the team_id."],"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-14T00:17:10.932Z"}