A group field operates on the same principle as a repeater field. It is a repeater field that always has 1 row. I have not tried it but I would assume that update_sub_field()
is what you’re looking for https://www.advancedcustomfields.com/resources/update_sub_field/