The POST /environments/{environmentId}/users operation adds a new user resource to the specified environment.

This operation does not support an attribute to set the new user’s password. To create a user and set the password, see Import a user. For information about setting a user’s password after creating the new user, see Set password.

New users must be assigned to a population resource identified by its ID, and the request must set a value for the username attribute.

The username value must be unique to an environment (spanning populations). Access to populations is determined by roles. It’s possible that username conflicts may arise, if you or your worker application attempt to create a user that exists in a population to which you have no access.

New users who are not authenticating with PingOne must be assigned an identity provider with the identityProvider.id attribute. If identityProvider.id is not provided, PingOne is set as the default identity provider. The identityProvider.type value is read-only, and its value is dependent on the value of identityProvider.id. If identityProvider.id is not provided, the default value of identityProvider.type is PING_ONE.

In the example, locales is a multi-value custom attribute. Its value must be an array, regardless of the number of values provided.

If successful, the response returns a 201 Successfully created message and shows the new user resource’s property data.