{"record":{"id":"3393483c925d3905","repo":"BerriAI/litellm","slug":"you-can-only-view-teams-within-your-organizations","errorCode":null,"errorMessage":"You can only view teams within your organizations.","messagePattern":"You can only view teams within your organizations\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":4744,"sourceCode":"    org_admin_org_ids: list[str] | None = None\n\n    if is_proxy_admin:\n        return user_id, org_admin_org_ids\n\n    # Always check org admin status so that even own-queries see\n    # the full set of organisation teams, not just direct memberships.\n    if user_api_key_dict.user_id:\n        org_admin_org_ids = await _get_org_admin_org_ids(\n            user_id=user_api_key_dict.user_id,\n            prisma_client=prisma_client,\n            user_api_key_cache=user_api_key_cache,\n            proxy_logging_obj=proxy_logging_obj,\n        )\n\n    if org_admin_org_ids is not None:\n        # Org admin: validate org_id filter if provided\n        if organization_id and organization_id not in org_admin_org_ids:\n            raise HTTPException(\n                status_code=403,\n                detail={\"error\": \"You can only view teams within your organizations.\"},\n            )\n        # When the caller is an org admin querying their own teams (or no\n        # specific user), null out user_id so that\n        # _build_team_list_where_conditions scopes only by organization_id\n        # — org admins should see all teams in their orgs, not just teams\n        # they are a direct member of.  Keep user_id when the org admin\n        # explicitly queries a *different* user's teams.\n        if user_id is None or user_id == user_api_key_dict.user_id:\n            user_id = None\n        verbose_proxy_logger.debug(\n            \"list_team_v2: org admin access for user=%s, org_ids=%s, user_id_filter=%s\",\n            user_api_key_dict.user_id,\n            org_admin_org_ids,\n            user_id,\n        )\n    else:","sourceCodeStart":4726,"sourceCodeEnd":4762,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L4726-L4762","documentation":"Error \"You can only view teams within your organizations.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:4744 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Query only teams within your own organizations, or use a proxy admin key."],"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"}