{"record":{"id":"cb11ac8c97713d6b","repo":"BerriAI/litellm","slug":"team-id-in-body-data-team-id-does-not-match-te","errorCode":null,"errorMessage":"team_id in body ({data.team_id}) does not match team_id in path ({team_id})","messagePattern":"team_id in body \\((.+?)\\) does not match team_id in path \\((.+?)\\)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":2309,"sourceCode":"    curl --location --request PATCH 'http://0.0.0.0:4000/team/8d916b1c-510d-4894-a334-1c16a93344f5' \\\n    --header 'Authorization: Bearer sk-1234' \\\n    --header 'Content-Type: application/json' \\\n    --data-raw '{\n        \"metadata\": {\"cost_center\": \"1234\", \"deprecated_key\": null}\n    }'\n    ```\n    \"\"\"\n    from litellm.proxy.proxy_server import prisma_client\n\n    try:\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        if data.team_id is not None and data.team_id != team_id:\n            raise HTTPException(\n                status_code=400,\n                detail={\"error\": f\"team_id in body ({data.team_id}) does not match team_id in path ({team_id})\"},\n            )\n\n        patch_fields: Final = data.model_dump(exclude_unset=True, exclude={\"team_id\"})\n\n        if \"metadata\" in patch_fields:\n            existing_team_row: Final = await _team_db(prisma_client).find_unique(where={\"team_id\": team_id})\n            if existing_team_row is None:\n                raise HTTPException(\n                    status_code=404,\n                    detail={\"error\": f\"Team not found, passed team_id={team_id}\"},\n                )\n            existing_metadata = existing_team_row.metadata if isinstance(existing_team_row.metadata, dict) else {}\n            patch_fields[\"metadata\"] = apply_json_merge_patch(existing_metadata, patch_fields[\"metadata\"])\n\n        update_request: Final = UpdateTeamRequest.model_validate({\"team_id\": team_id, **patch_fields})\n","sourceCodeStart":2291,"sourceCodeEnd":2327,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L2291-L2327","documentation":"Error \"team_id in body ({data.team_id}) does not match team_id in path ({team_id})\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:2309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the team_id in the request body match the team_id in the URL path, or omit it from the body."],"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"}