POST /users

Create a local user. Authentication is required.

Request format

When Forming RBAC API requests to this endpoint, the content type is application/json. The body must be a JSON object using the following keys:

  • email: Specify the user's email address.
  • display_name: The user's name as you want it shown in the console.
  • login: The username for the user to use to login.
  • role_ids: An array of role IDs defining the roles that you want to assign to the new user. An empty array is valid, but the user can't do anything in PE if they are not assigned to any roles.
  • password: A password the user can use to login. For the password to work in the PE console, it must be at least six characters. This field is optional, however user accounts are not usable until a password is set. You can also use the Passwords endpoints to generate a password reset token the user can use to login for the first time.

For example:

curl -X POST "https://$(puppet config print server):4433/rbac-api/v1/users" \
-H "X-Authentication: $(puppet-access show)"  \
-H "Content-type:   application/json" \
-d '{"login": "Kalo",
     "email": "kalohill@example.com", 
     "display_name": "Kalo Hill",
     "role_ids": [1123,6643,1218],
     "password": "Welc0me!"}'

Response format

If creation is successful, the endpoint returns 201 Created with a location header pointing to the new resource.

Error responses

If the email or login for the user conflicts with an existing user's login, the endpoint returns a 409 Conflict response.

For other errors, refer to RBAC service errors .