{"record":{"id":"67b482919af02dbd","repo":"BerriAI/litellm","slug":"must-provide-team-ids-or-set-apply-to-all-teams-tr","errorCode":null,"errorMessage":"Must provide team_ids or set apply_to_all_teams=true","messagePattern":"Must provide team_ids or set apply_to_all_teams=true","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":5586,"sourceCode":"    from litellm.proxy.proxy_server import prisma_client\n\n    if prisma_client is None:\n        raise HTTPException(status_code=500, detail={\"error\": \"No db connected\"})\n\n    if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN.value:\n        raise HTTPException(\n            status_code=403,\n            detail={\"error\": \"Only proxy admins can bulk-update team permissions\"},\n        )\n\n    if not data.permissions:\n        return {\n            \"message\": \"No permissions provided\",\n            \"teams_updated\": 0,\n        }\n\n    if not data.apply_to_all_teams and not data.team_ids:\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"Must provide team_ids or set apply_to_all_teams=true\"},\n        )\n\n    if data.apply_to_all_teams and data.team_ids:\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"Cannot set both apply_to_all_teams=true and team_ids\"},\n        )\n\n    permissions_to_add: Final = set(data.permissions)\n\n    if data.team_ids:\n        teams_updated = await _append_permissions_to_specific_teams(prisma_client, data.team_ids, permissions_to_add)\n    else:\n        teams_updated = await _append_permissions_to_all_teams(prisma_client, permissions_to_add)\n\n    return {","sourceCodeStart":5568,"sourceCodeEnd":5604,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L5568-L5604","documentation":"Error \"Must provide team_ids or set apply_to_all_teams=true\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:5586 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a team_ids list, or set apply_to_all_teams=true."],"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"}