{"record":{"id":"c2da446f1521d7ae","repo":"BerriAI/litellm","slug":"organization-organization-id-not-found","errorCode":null,"errorMessage":"Organization={organization_id} not found","messagePattern":"Organization=(.+?) not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/organization_endpoints.py","lineNumber":947,"sourceCode":"        )\n\n    deleted_orgs: Final = []\n    for organization_id in data.organization_ids:\n        # delete all teams in the organization\n        await _table(TeamRepository(prisma_client)).delete_many(where={\"organization_id\": organization_id})\n        # delete all members in the organization\n        await _table(OrganizationMembershipRepository(prisma_client)).delete_many(\n            where={\"organization_id\": organization_id}\n        )\n        # delete all keys in the organization\n        await _table(VerificationTokenRepository(prisma_client)).delete_many(where={\"organization_id\": organization_id})\n        # delete the organization\n        deleted_org = await _table(OrganizationRepository(prisma_client)).delete(\n            where={\"organization_id\": organization_id},\n            include={\"members\": True, \"teams\": True, \"litellm_budget_table\": True},\n        )\n        if deleted_org is None:\n            raise HTTPException(\n                status_code=404,\n                detail={\"error\": f\"Organization={organization_id} not found\"},\n            )\n        deleted_orgs.append(deleted_org)\n\n    return deleted_orgs\n\n\n@router.get(\n    \"/organization/list\",\n    tags=[\"organization management\"],\n    dependencies=[Depends(user_api_key_auth)],\n    response_model=list[LiteLLM_OrganizationTableWithMembers],\n)\nasync def list_organization(\n    org_id: str | None = fastapi.Query(default=None, description=\"Filter organizations by exact organization_id match\"),\n    org_alias: str | None = fastapi.Query(\n        default=None,","sourceCodeStart":929,"sourceCodeEnd":965,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/organization_endpoints.py#L929-L965","documentation":"Lookup guard inside the org delete loop: one of the organization_ids in the batch has no matching org row when its resources are being cleaned up, so the delete is aborted with 404 for that id. Partial deletes of earlier ids in the loop may already have occurred.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/organization_endpoints.py:947 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"}