{"record":{"id":"6a18800e9c07423e","repo":"BerriAI/litellm","slug":"key-or-team-not-found-for-the-given-identifier","errorCode":null,"errorMessage":"Key or team not found for the given identifier","messagePattern":"Key or team not found for the given identifier","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/tool_management_endpoints.py","lineNumber":630,"sourceCode":"    )\n    from litellm.proxy.proxy_server import prisma_client\n\n    if prisma_client is None:\n        raise HTTPException(status_code=500, detail=CommonProxyErrors.db_not_connected_error.value)\n\n    try:\n        if data.team_id is not None or data.key_hash is not None:\n            if data.team_id is not None and data.key_hash is not None:\n                raise HTTPException(\n                    status_code=400,\n                    detail=\"Provide either team_id or key_hash, not both\",\n                )\n            if data.key_hash is not None:\n                op_id = await _resolve_key_hash_to_object_permission_id(prisma_client, data.key_hash)\n            else:\n                op_id = await _resolve_team_id_to_object_permission_id(prisma_client, data.team_id or \"\")\n            if op_id is None:\n                raise HTTPException(\n                    status_code=404,\n                    detail=\"Key or team not found for the given identifier\",\n                )\n            is_blocking: Final = data.input_policy == \"blocked\"\n            if is_blocking:\n                ok = await add_tool_to_object_permission_blocked(\n                    prisma_client=prisma_client,\n                    object_permission_id=op_id,\n                    tool_name=data.tool_name,\n                )\n            else:\n                ok = await remove_tool_from_object_permission_blocked(\n                    prisma_client=prisma_client,\n                    object_permission_id=op_id,\n                    tool_name=data.tool_name,\n                )\n            if not ok:\n                raise HTTPException(","sourceCodeStart":612,"sourceCodeEnd":648,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/tool_management_endpoints.py#L612-L648","documentation":"Error \"Key or team not found for the given identifier\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/tool_management_endpoints.py:630 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the team_id or key_hash identifies an existing team/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"}