{"record":{"id":"de45b28822bdaf57","repo":"BerriAI/litellm","slug":"available-team-self-join-cannot-assign-admin-rol","errorCode":null,"errorMessage":"Available-team self-join cannot assign 'admin' role. Only proxy/team/org admins can add admins to a team.","messagePattern":"Available-team self-join cannot assign 'admin' role\\. Only proxy/team/org admins can add admins to a team\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":2535,"sourceCode":"        raise HTTPException(\n            status_code=403,\n            detail={\n                \"error\": (\n                    \"Available-team self-join cannot set per-member budget or \"\n                    \"model controls (max_budget_in_team, budget_duration, \"\n                    \"allowed_models); these are admin-only.\"\n                )\n            },\n        )\n\n    # Available-team self-join: caller may add only themselves, only as a\n    # standard user.  Enforce that here so the bypass cannot be used as a\n    # privilege-escalation or cross-user-injection primitive.\n    members: Final = data.member if isinstance(data.member, list) else [data.member]\n    caller_user_id: Final = getattr(user_api_key_dict, \"user_id\", None)\n    for member in members:\n        if getattr(member, \"role\", \"user\") != \"user\":\n            raise HTTPException(\n                status_code=403,\n                detail={\n                    \"error\": (\n                        \"Available-team self-join cannot assign 'admin' role. \"\n                        \"Only proxy/team/org admins can add admins to a team.\"\n                    )\n                },\n            )\n        member_user_id = getattr(member, \"user_id\", None)\n        if not caller_user_id or not member_user_id or member_user_id != caller_user_id:\n            raise HTTPException(\n                status_code=403,\n                detail={\n                    \"error\": (\n                        \"Available-team self-join can only add the caller \"\n                        \"(user_id must match the authenticated user's user_id).\"\n                    )\n                },","sourceCodeStart":2517,"sourceCodeEnd":2553,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L2517-L2553","documentation":"Error \"Available-team self-join cannot assign 'admin' role. Only proxy/team/org admins can add admins to a team.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:2535 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Self-join with the default 'user' role; ask a proxy/team/org admin to grant the admin role."],"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"}