BerriAI/litellm · error · HTTPException

Only proxy admins can update the user banner.

Error message

Only proxy admins can update the user banner.

What it means

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.

Source

Thrown at litellm/proxy/ui_crud_endpoints/user_banner_endpoints.py:103


@router.patch(
    "/update/user_banner",
    tags=["UI Settings"],  # mutable-ok: FastAPI's route decorator only accepts a list
    response_model=UpdateUserBannerResponse,
)
async def update_user_banner(
    banner_update: UserBannerUpdate,
    user_api_key_dict: Annotated[UserAPIKeyAuth, Depends(user_api_key_auth)],
) -> UpdateUserBannerResponse:
    """
    Publish, edit, or unpublish the dashboard banner.
    Only proxy admins are allowed to modify it.
    """
    from litellm.proxy.proxy_server import create_config_audit_log, prisma_client

    if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN:
        raise HTTPException(status_code=403, detail="Only proxy admins can update the user banner.")

    if prisma_client is None:
        raise HTTPException(status_code=500, detail="Database not connected. Please connect a database.")

    repository: Final = UserBannerRepository(prisma_client)
    before: Final = parse_user_banner(await repository.get_raw_settings())
    banner: Final = UserBanner(
        enabled=banner_update.enabled,
        message=banner_update.message,
        severity=banner_update.severity,
        revision=uuid4().hex,
    )

    await repository.upsert_settings(json.dumps(banner.model_dump()))

    asyncio.create_task(
        create_config_audit_log(
            param_name=USER_BANNER_ROW_ID,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use a proxy admin key to update the user banner.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/ui_crud_endpoints/user_banner_endpoints.py:103 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/57046b989f5ab2c2. Report an issue: GitHub.