Admin API Status 400 Bad Requiest

I’m using the admin API in Java.
When trying to create a user providing a login, firstName, lastName and password. I get BAD REQUEST error 400. I have configured the keycloak container with DEBUG logging and can see the authentication to the server with the realm-management clientId is successful.

Any ideas on what might be missing?

Check if the following helps you further Keycloak Admin Client in Spring Boot

Thanks, I tried using admin-cli and could also authenticate but then BAD REQUEST again with nothing in the logs.
loglevel =TRACE it is.

maybe you could provide more information about the command you are executing.
Also take a look in the returning headers, sometimes these also contain more information.

So eventually the solution was:
Create a new user that will be the admin user lets called user-admin
Assign user-admin roles from the realm-management client.
The calls needed to use the admin-cli clientId with the user-admin username and password.
Interesting that using realm-managment clientId and clientSecret didn’t work.