is there any way to do this?
I saw some java api support this, like createGroup...
Groups do not belong to spaces, so no. Unless you mean you want to create some sort of functionality which allows you to build lists of users inside a space and then write something else that uses these lists.
You can write code that would create groups and then add them to space permissions of course.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.