BerriAI/litellm · error · HTTPException

Only proxy admins can update all users at once.

Error message

Only proxy admins can update all users at once.

What it means

Error "Only proxy admins can update all users at once." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/internal_user_endpoints.py:1756

        )

    # Only proxy admins can modify user_role in bulk updates
    _bulk_role = getattr(data.user_updates, "user_role", None) if data.user_updates else None
    if _bulk_role is None and data.users:
        _bulk_role = next((u.user_role for u in data.users if u.user_role is not None), None)
    if _bulk_role is not None and user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN.value:
        raise HTTPException(
            status_code=403,
            detail="Only proxy admins can modify user roles.",
        )

    # Determine the list of users to update
    users_to_update: list[UpdateUserRequest] | list[UpdateUserRequestNoUserIDorEmail] = []

    if data.all_users and data.user_updates:
        # Only proxy admins can update all users at once
        if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN.value:
            raise HTTPException(
                status_code=403,
                detail="Only proxy admins can update all users at once.",
            )
        # Optimized path for updating all users directly in database
        all_users_in_db: Final = await _user_table(prisma_client).find_many(order={"created_at": "desc"})

        if not all_users_in_db:
            raise HTTPException(
                status_code=400,
                detail={"error": "No users found to update"},
            )

        # Limit batch size to prevent overwhelming the system
        MAX_BATCH_SIZE = 500  # Increased limit for all-users operations
        if len(all_users_in_db) > MAX_BATCH_SIZE:
            raise HTTPException(
                status_code=400,
                detail={

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Call this endpoint with a proxy admin API key (user_role=PROXY_ADMIN).
  2. If you need to update many users, ask a proxy admin to run the bulk update, or update users individually with your own permissions.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/internal_user_endpoints.py:1756 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/c519370499ebcb16. Report an issue: GitHub.