Sure! Everything you can do through the UI can be done through the API, the UI is using the API
Just remove a user from a group while watching the networks requests in your Browser’s Dev tools to see how this API call works. The following How-To has details:
If you have any trouble following this, just let us know