{"record":{"id":"413b36c40e8eb29c","repo":"BerriAI/litellm","slug":"team-id-team-id-does-not-exist-please-use-a-d","errorCode":null,"errorMessage":"Team id = {team_id} does not exist. Please use a different team id.","messagePattern":"Team id = (.+?) does not exist\\. Please use a different team id\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_callback_endpoints.py","lineNumber":283,"sourceCode":"    \"\"\"\n    try:\n        from litellm.proxy._types import CommonProxyErrors\n        from litellm.proxy.proxy_server import (\n            prisma_client,\n            proxy_logging_obj,\n            user_api_key_cache,\n        )\n\n        if prisma_client is None:\n            raise HTTPException(\n                status_code=500,\n                detail={\"error\": CommonProxyErrors.db_not_connected_error.value},\n            )\n\n        # Check if team_id exists already\n        _existing_team = await prisma_client.get_data(team_id=team_id, table_name=\"team\", query_type=\"find_unique\")\n        if _existing_team is None:\n            raise HTTPException(\n                status_code=400,\n                detail={\"error\": f\"Team id = {team_id} does not exist. Please use a different team id.\"},\n            )\n\n        # IDOR guard: only proxy admins / org admins / team admins of THIS\n        # team may write callback credentials. Without this, any\n        # authenticated key holder could overwrite another team's logging\n        # config (and read back the credentials they wrote).\n        await _verify_team_access(\n            team_obj=LiteLLM_TeamTable(**_existing_team.model_dump()),\n            user_api_key_dict=user_api_key_dict,\n        )\n\n        # store team callback settings in metadata\n        team_metadata = _existing_team.metadata\n        team_callback_settings: list[dict] = team_metadata.get(\"logging\")  # will be dict of type AddTeamCallback\n        if team_callback_settings is None or not isinstance(team_callback_settings, list):\n            team_callback_settings = []","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_callback_endpoints.py#L265-L301","documentation":"POST /team/{team_id}/callback checks that the target team exists before storing callback settings; a missing team means the caller used an unknown or deleted team_id, so a 404 with guidance to pick another id is raised.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_callback_endpoints.py:283 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an existing team id; verify via /team/list."],"exampleFix":null,"handlingStrategy":"validation","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"}