# Java-SDK userType/Profile on UserBuilder missing?

**URL:** <https://devforum.okta.com/t/java-sdk-usertype-profile-on-userbuilder-missing/13022>\
**Category:** Questions\
**Created:** [February 22, 2021, 11:12am UTC](https://devforum.okta.com/t/java-sdk-usertype-profile-on-userbuilder-missing/13022 "2021-02-22T11:12:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TeaTiMe08](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/teatime08/32/2662_2.png) [@TeaTiMe08](https://devforum.okta.com/u/TeaTiMe08)\
**Post date:** [February 22, 2021, 11:12am UTC](https://devforum.okta.com/t/java-sdk-usertype-profile-on-userbuilder-missing/13022/1 "2021-02-22T11:12:28Z")

</div>

I want to use your Java-SDK to create new users with a specific Profile/userType, which has specific profile attributes to them.  
I have searched for an answer in your Wiki and in the READMEs, but did not find a clue how to create a new user with a certain userType to be able to fill in the attributes.  
I would be glad for an answer!

---

<div class="post-metadata">

**Author:** ![Cale](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/cale/32/2496_2.png) [@Cale](https://devforum.okta.com/u/Cale)\
**Post date:** [February 22, 2021, 6:16pm UTC](https://devforum.okta.com/t/java-sdk-usertype-profile-on-userbuilder-missing/13022/2 "2021-02-22T18:16:04Z")

</div>

Hi there. You should be able to use `setType` in `UserBuilder`. Check out our API docs here for the Java SDK:

[https://developer.okta.com/okta-sdk-java/apidocs/com/okta/sdk/resource/user/UserBuilder.html](https://developer.okta.com/okta-sdk-java/apidocs/com/okta/sdk/resource/user/UserBuilder.html)

---

<div class="post-metadata">

**Author:** ![TeaTiMe08](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/teatime08/32/2662_2.png) [@TeaTiMe08](https://devforum.okta.com/u/TeaTiMe08)\
**Post date:** [February 22, 2021, 6:51pm UTC](https://devforum.okta.com/t/java-sdk-usertype-profile-on-userbuilder-missing/13022/3 "2021-02-22T18:51:20Z")

</div>

Yeah… After 5h of upgrading the okta-sdk-java (before standard okta-spring-sdk) and okta-spring-boot to version 2.0.1 (before 1.5.1) there was a possibility while:

User user = UserBuilder.instance().setType(type.getId()).buildAndCreate();

would work for me, otherwise if you create the user first then set the profile

User user = UserBuilder.instance(){blahblah}.buildAndCreate();  
user.setType(type.getId());

, there will appear the error code casually:

{  
“errorCode”: “E0000003”,  
“errorSummary”: “The request body was not well-formed {blahblah}”,  
“errorLink”: “E0000003”,  
“errorId”: “oaeqgZFFjUXS2qcagR7-PIBYA”,  
“errorCauses”:   
}

So, if you would implement the setType() method in 1.5.X version, this would be fine.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 26, 2024, 11:41pm UTC](https://devforum.okta.com/t/java-sdk-usertype-profile-on-userbuilder-missing/13022/4 "2024-01-26T23:41:17Z")

</div>


