Remove groups from User via REST API

I had a look at the REST API of NEXUS, but did not find how to remove groups from users. We would like to automize this task.
Is it possible to do so via REST API at all?
Thanks for an answer…

Does the PUT /v1/rest/security/users/{userId} API not do exactly that? Just change the list of roles on the user to remove a role from them.

Is there any documentation about it?

I understand your point, but could you be more precise or give an example, please?

All the rest APIs are documented in product under Admin > System > API. You’d probably want to GET /v1/rest/security/users/{userId}, parse the resulting json and remove the role from the list of roles, then PUT /v1/rest/security/users/{userId} with the modified json to remove a role from a user.

I managed to communicate with the rest api through the nexus-gui under api, but not from the command line of the linux server hosting nexus:
curl -v -su ‘USER’ --noproxy ‘*’ -X GET ‘’ -H “Content-Type: application/json”
Enter host password for user USER:

  • About to connect() to port 443 (#0)
  • Trying…
  • Connection refused
  • Failed connect to; Connection refused
  • Closing connection 0

Is some configuration missing to allow using the rest api via command line?
The USER has all rights granted.

It is http on localhost.