REST API  16
REST API for Luna Network HSMs
POST /users

POST /users

This resource creates a REST API user. Created user will be accessible in LunaSH too.

User Privileges

Users with the following role privileges can perform this command:

  • admin

Parameters

userId

The user ID of the user to create. No two users can have the same name.

Use: Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 32
   pattern: [a-zA-Z_][a-zA-Z0-9._-]{0,31}

fullName

The full name of the user.

Use: Not Required

JSON Schema:

   Object
   type: string
   pattern: [a-zA-Z0-9_ -]

email

The email address associated with the user. An email cannot be empty, if provided.

Use: Not Required

JSON Schema:

   Object
   type: string

role

The role associated with the user. No two roles can have the same name. User can be created without role by providing empty value.

Use: Required

JSON Schema:

   Object
   type: string
   minLength: 0
   maxLength: 64
   pattern: [a-zA-Z0-9_]

password

The password associated with the user.

Note: The password must be at least 8 characters long.
The password must contain characters from at least 3 of the following 4 categories:

  • Uppercase letters (A through Z)
  • Lowercase letters (a through z)
  • Numbers (0 through 9)
  • Non-alphanumeric characters (special characters allowed for user password in REST API are $, (, ), *, +, -, ., /, ^, [, ], {, }, !, #, %, ,(comma), :, =, @, ~, &, _, |, ;, <, >, `, ?, Single quote and Double quote)

Use: Required

JSON Schema:

    Object
    type: string
    minLength: 8
    maxLength: 255
    pattern: [a-zA-Z0-9_ $()*+./^[]{}!#%,:=@~'&|<>?`;"-]

Responses

204

Success

Location

"Location" is the URL to the newly created user.

400

Unexpected failure

Example Request with role

    POST
    https://1.2.3.4:8443/users
    {
       "userId": "restUser",
       "fullName": "restUserName",
       "email": "rest_user@email.com",
       "role": "monitor",
       "password": "restPass123"
    }

Example Request without role

    POST
    https://1.2.3.4:8443/users
    {
       "userId": "restuser",
       "fullName": "restUserName",
       "email": "rest_user@email.com",
       "role": "",
       "password": "restPass123"
    }

Example Response

    {
    }

Notes