{"record":{"id":"57046b989f5ab2c2","repo":"BerriAI/litellm","slug":"only-proxy-admins-can-update-the-user-banner","errorCode":null,"errorMessage":"Only proxy admins can update the user banner.","messagePattern":"Only proxy admins can update the user banner\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/ui_crud_endpoints/user_banner_endpoints.py","lineNumber":103,"sourceCode":"\n\n@router.patch(\n    \"/update/user_banner\",\n    tags=[\"UI Settings\"],  # mutable-ok: FastAPI's route decorator only accepts a list\n    response_model=UpdateUserBannerResponse,\n)\nasync def update_user_banner(\n    banner_update: UserBannerUpdate,\n    user_api_key_dict: Annotated[UserAPIKeyAuth, Depends(user_api_key_auth)],\n) -> UpdateUserBannerResponse:\n    \"\"\"\n    Publish, edit, or unpublish the dashboard banner.\n    Only proxy admins are allowed to modify it.\n    \"\"\"\n    from litellm.proxy.proxy_server import create_config_audit_log, prisma_client\n\n    if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN:\n        raise HTTPException(status_code=403, detail=\"Only proxy admins can update the user banner.\")\n\n    if prisma_client is None:\n        raise HTTPException(status_code=500, detail=\"Database not connected. Please connect a database.\")\n\n    repository: Final = UserBannerRepository(prisma_client)\n    before: Final = parse_user_banner(await repository.get_raw_settings())\n    banner: Final = UserBanner(\n        enabled=banner_update.enabled,\n        message=banner_update.message,\n        severity=banner_update.severity,\n        revision=uuid4().hex,\n    )\n\n    await repository.upsert_settings(json.dumps(banner.model_dump()))\n\n    asyncio.create_task(\n        create_config_audit_log(\n            param_name=USER_BANNER_ROW_ID,","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/ui_crud_endpoints/user_banner_endpoints.py#L85-L121","documentation":"Role gate on PATCH /update/user_banner: the caller's user_role is not PROXY_ADMIN. The banner is broadcast to every authenticated dashboard user, so only proxy admins may publish, edit, or unpublish it.","triggerScenarios":"Thrown at litellm/proxy/ui_crud_endpoints/user_banner_endpoints.py:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a proxy admin key to update the user banner."],"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-14T00:17:10.932Z"}