Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

General Information

...

ServiceAPIMethod
urac/admin/addUserPOST


Data Model: %Link to Data Model%

Workflow: %Link to Architecture Page%

Input

Models: UsersTokens

WorkFlow: Add User Flow

Input

...

Type: application/json
Name
SourceMandatoryTypeSpecial FormatDescription
 
usernameBodyYESStringalphanumeric with _ , - characters only
firstNameBodyYESStringN/A
lastNameBodyYESStringN/A
emailBodyYESStringEmail Address Format (JSON Schema Validation)
profileBodyNOObjectN/A
 

...

The profile object.
groupsBodyNOArrayN/Aarray of group code values
statusbodyNOString - enum
'active', 'inactive', 'pendingNew'

passwordbodyNOString

confirmationbodyNOStringValue is as same as password
pin
bodyNO



code
YESString


allowed
YESboolean


Output

...

Valid Response

Code Block
languagejs
titleValid Response Sample
{
	"result": true,
	"data": { 		"..."	
	}
}

...


Invalid Response

Code Block
languagejs
titleError Response Sample
{
    "result":false,
    "errors":{
        "codes":[400402],
        "details":[
            {
                "code":400402,
                "message":"ProblemUser withaccount the provided passwordalready exists."
            }
        ]
    }
}



Error Codes

 



Code
Description
400Database
Error
connection error
402User account already exists.
414Unable to add user.
611invalid tenant id provided


Example (CURL)

...

Request

Code Block
languagebash
titleCalling YOUR Add User API
 > CURL -X POST http://127.0.0.1:4000/urac/admin/...addUser -d 'username=john&firstName=John&lastName=Doe&email=johndoe@domain.com'

Response

Code Block
languagejs
titleYOUR Add User API response
{
	"result": true,
	"data": {
		"_id": "57063608622c47b5c097d19b57c6eb28962f94a7caab8a22", 
		"..."token": "719b0aed-edd8-47d5-ada0-9e5f93cb8247"
	}
}