Legacy Knowledge Base
Published Sep. 10, 2025

What 'type' parameter should I provide to the addUser() function when creating a User through API?

Written By

Adorjan Meszaros

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • I would like to create a user via UserLocalServiceUtil.addUser()
  • One of the parameters required is 'int type'.
  • What value should I provide to this type parameter?

Environment

  • DXP 7.4
  • Quarterly Releases

Resolution

  • The type parameter defines the user in a global scope:
    • 0: GUEST (e.g. for Commerce use cases);
    • 1: REGULAR;
    • 2: DEFAULT_SERVICE_ACCOUNT
  • For the purpose of creating a new user, type should be 1.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base