How to assign roles to a user with java management api

What i mean with Java management API is actually the library of the management API for Java: GitHub - auth0/auth0-java: Java client library for the Auth0 platform

I tried to change the roles of a user with the java library and with http request and didnt achieve success in both. Fot the http request case I created a new post: Management API v2 /api/v2/users/{id}/roles gives error 400 with message Schema violation