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.

Thanks.
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 ‘https://127.0.0.1/service/rest/v1/status’ -H “Content-Type: application/json”
Enter host password for user USER:

  • About to connect() to 127.0.0.1 port 443 (#0)
  • Trying 127.0.0.1…
  • Connection refused
  • Failed connect to 127.0.0.1:443; 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.

Hello,
I’ve searched a lot about nexus REST API documentation and here is what I’ve found:
<nexus URL>/service/rest/swagger.json
You can see lots of endpoints here but for example, for retrieving users you can use this API :
<nexus url>/service/rest/beta/security/users
in case you had any questions about other APIs, just let me know. Maybe I could help :slight_smile: