API - Add User to moderator group

Thanks for your reply.

I thought of the same at one point but I have admin api key and its still the same error

Additionally, instead of moderator if I try to add the user to any other custom group it gets added successfully.