{"record":{"id":"61611f58cb302401","repo":"BerriAI/litellm","slug":"organization-not-found-passed-organization-id-or","errorCode":null,"errorMessage":"Organization not found, passed organization_id={organization_id}","messagePattern":"Organization not found, passed organization_id=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":1738,"sourceCode":"        llm_router: The LLM router instance\n        prisma_client: The Prisma database client\n\n    Returns:\n        The organization row from the database\n\n    Raises:\n        HTTPException: If llm_router is None, organization not found, or validation fails\n    \"\"\"\n    if llm_router is None:\n        raise HTTPException(status_code=500, detail={\"error\": CommonProxyErrors.no_llm_router.value})\n\n    organization_row: Final = await _org_db(prisma_client).find_unique(\n        where={\"organization_id\": organization_id},\n        include={\"litellm_budget_table\": True, \"members\": True, \"teams\": True},\n    )\n\n    if organization_row is None:\n        raise HTTPException(\n            status_code=404,\n            detail={\"error\": f\"Organization not found, passed organization_id={organization_id}\"},\n        )\n\n    is_proxy_admin = user_api_key_dict is not None and user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN\n    organization: Final = LiteLLM_OrganizationTableWithMembers.model_validate(organization_row.model_dump())\n    validate_team_org_change(\n        team=LiteLLM_TeamTable.model_validate(existing_team_row.model_dump()),\n        organization=organization,\n        llm_router=llm_router,\n        is_proxy_admin=is_proxy_admin,\n    )\n\n    if is_proxy_admin:\n        await _auto_add_team_members_to_organization(\n            team=LiteLLM_TeamTable.model_validate(existing_team_row.model_dump()),\n            organization=organization,\n            prisma_client=prisma_client,","sourceCodeStart":1720,"sourceCodeEnd":1756,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L1720-L1756","documentation":"The organization lookup during team update returns no row for the given organization_id: the team is being attached to an org that does not exist (deleted or mistyped id), so a 404 naming the id is raised before limit validation.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1738 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the organization_id exists via /organization/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"}