{"record":{"id":"2cc139f40dbc38ef","repo":"BerriAI/litellm","slug":"organization-not-found-for-organization-id-data-o-2cc139","errorCode":null,"errorMessage":"Organization not found for organization_id={data.organization_id}","messagePattern":"Organization not found for organization_id=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":1378,"sourceCode":"                and isinstance(litellm.default_team_settings[0], dict)\n            ):\n                default_budget: Final = litellm.default_team_settings[0].get(\"max_budget\")\n                if default_budget is not None:\n                    data.max_budget = default_budget\n\n        # check org key limits - done here to handle inheriting org id from team\n        if data.organization_id is not None and prisma_client is not None:\n            try:\n                org_table = await get_org_object(\n                    org_id=data.organization_id,\n                    user_api_key_cache=user_api_key_cache,\n                    prisma_client=prisma_client,\n                    include_budget_table=True,\n                )\n            except OrganizationNotFoundError:\n                org_table = None\n            if org_table is None:\n                raise HTTPException(\n                    status_code=400,\n                    detail=f\"Organization not found for organization_id={data.organization_id}\",\n                )\n\n            await _check_org_team_limits(\n                org_table=org_table,\n                data=data,\n                prisma_client=prisma_client,\n            )\n\n        if (\n            user_api_key_dict.user_role is None or user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN\n        ):  # don't restrict proxy admin\n            # Only validate user budget/models/tpm/rpm for standalone teams (not org-scoped)\n            # For org-scoped teams, validation is done by _check_org_team_limits()\n            if data.organization_id is None:\n                await _check_user_team_limits(\n                    data=data,","sourceCodeStart":1360,"sourceCodeEnd":1396,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L1360-L1396","documentation":"When a new team specifies organization_id, the org is fetched to inherit settings and run org limit checks; if get_org_object cannot find the organization, this 404 names the requested organization_id as nonexistent or misspelled.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1378 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify data.organization_id matches an existing organization 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"}