{"record":{"id":"d63398585ea7a918","repo":"BerriAI/litellm","slug":"cannot-set-both-apply-to-all-teams-true-and-team-i","errorCode":null,"errorMessage":"Cannot set both apply_to_all_teams=true and team_ids","messagePattern":"Cannot set both apply_to_all_teams=true and team_ids","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":5592,"sourceCode":"        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 {\n        \"message\": \"Team permissions updated successfully\",\n        \"teams_updated\": teams_updated,\n        \"permissions_appended\": data.permissions,\n    }\n\n","sourceCodeStart":5574,"sourceCodeEnd":5610,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L5574-L5610","documentation":"Error \"Cannot set both apply_to_all_teams=true and team_ids\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:5592 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass either apply_to_all_teams=true or an explicit team_ids list, not both."],"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"}