I am trying to create user by following JasperServer rest api I am using JasperServer version 5.6.0 ,when I am passing put request with json data I am getting 400 Bad Request error Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("jasperadmin", "jasperadmin".toCharArray()); } }); String input = "{"username":"AgentUser22","password":"jasperadmi","fullname":"Agent User","emailAddress":"aamitt06@gmail.com","enabled":true,"externallyDefined":false,"roles":[{"name":"ROLE_AGENT"}]}"; JSONObject jObject = new JSONObject(input); ClientResponse response = service.path("rest_v2").path("users").path("AgentUser22").type("application/json") .put(ClientResponse.class,jObject);' System.out.println(jObject); if (response.getStatus() != 201) { throw new RuntimeException("Failed : HTTP error code : " + response.getStatus()); }