{"record":{"id":"c43f48068701c040","repo":"BerriAI/litellm","slug":"at-least-one-of-team-id-or-key-hash-is-required-to","errorCode":null,"errorMessage":"At least one of team_id or key_hash is required to identify the override","messagePattern":"At least one of team_id or key_hash is required to identify the override","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/tool_management_endpoints.py","lineNumber":722,"sourceCode":"    tool_name: str,\n    team_id: str | None = Query(None, description=\"Team ID of the override to remove\"),\n    key_hash: str | None = Query(None, description=\"Key hash of the override to remove\"),\n    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n):\n    \"\"\"\n    Remove a policy override for a tool. Specify the override by team_id or key_hash\n    (exactly one required).\n    \"\"\"\n    from litellm.proxy.db.tool_registry_writer import (\n        get_tool_policy_registry,\n        remove_tool_from_object_permission_blocked,\n    )\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    if team_id is None and key_hash is None:\n        raise HTTPException(\n            status_code=400,\n            detail=\"At least one of team_id or key_hash is required to identify the override\",\n        )\n    if team_id is not None and 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    try:\n        if key_hash is not None:\n            op_id = await _resolve_key_hash_to_object_permission_id(prisma_client, key_hash)\n        else:\n            op_id = await _resolve_team_id_to_object_permission_id(prisma_client, 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            )","sourceCodeStart":704,"sourceCodeEnd":740,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/tool_management_endpoints.py#L704-L740","documentation":"Error \"At least one of team_id or key_hash is required to identify the override\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/tool_management_endpoints.py:722 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide team_id or key_hash to identify which override to delete."],"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"}