POST - /admin/user
General Information
Service | API | Method | Data Models | Workflow |
---|---|---|---|---|
urac | /admin/user | POST | Users | N/A |
Description
This API adds a user record to the tenant that has the external key sent in the request headers.
Here is the business logic steps:
- Check is the user is already there, if yes return
- Check the type of tenant adding the user (main or sub tenant)
- if main tenant
- Add the user under the main tenant with the provided group
- if sub tenant
- Add the user under the main tenant
- Invite the user to this subtenant with the provided group
- if main tenant
- if pin object provided
- generate code if requested
- turn on pin login if allowed
- email the user the generated pin code using invitePin as documented under configuration
- if status is not provided, then pendingNew will be used as default
- if status is pendingNew then:
- a token with expiration date gets generated
- an email will be sent to the user using addUser as documented under configuration
- The email will contain a link protected by the generated token to be clicked to validate the user and set a password
- Once the user is validated, the status will be set to active (if status is not active the user will not be able to login)
- If status is active or inactive
- an email will be sent to the user with the password using addUser as documented under configuration
- if the password is not provided a generated password is sent to the user otherwise the provided password
Input
Type: application/json
Name | Source | Mandatory | Type | Special Format | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
username | Body | YES | String | N/A | Username | ||||||||||||
password | Body | NO | String | N/A | Password | ||||||||||||
Body | YES | String | Email format | ||||||||||||||
firstName | Body | YES | String | N/A | First Name | ||||||||||||
lastName | Body | YES | String | N/A | Last Name | ||||||||||||
profile | Body | NO | Object | N/A | Profile Object | ||||||||||||
status | Body | NO | String | active, inactive, or pendingNew | User Status default status if not provided is pendingNew | ||||||||||||
pin | Body | NO | Object | includes code and allowed | Pin Object | ||||||||||||
| |||||||||||||||||
groups | Body | NO | Array | Array of Strings | Groups array | ||||||||||||
ln | Body | NO | String | Language | |||||||||||||
phone | Body | NO | String | Phone number |
Output
Response
SOAJS has a unified response. Check out this link to understand more the schema of SOAJS response
Valid Response
Invalid Response
Code | Description |
---|---|
400 | Business logic required data are missing |
525 | Unable to generate pin at this time |
602 | Model error: + %model_error% |