PUT - /admin/user/self/invite

General Information


Service

API

Method

Data Model

Workflow

Service

API

Method

Data Model

Workflow

urac

/admin/user/self/invite

PUT

Users

 

Description

  • Get the user by id or email or username where status is active, if not provided get it from the access token.

  • if not found return error

  • if found continue with the following steps:

    •  check if already invited to this tenant

    • if yes return an error

    • if no, generate pin if code is set to yes 

      • if failed to generate pin return an error

    • invite the user by updating its allowedTenants

    • send an email to the user with the generated pin 

Input


Type: application/json



Name

Source

Mandatory

Type

Special Format

Description

Name

Source

Mandatory

Type

Special Format

Description

tenant

Body

YES

Object

Includes tenant id, and code

Tenant object

Name

Mandatory

type

Description

id

YES

string

tenant id

code

YES

string

tenant code

groups

Body

NO

Array

Array of strings

Groups array

pin

Body

NO

Object

Includes code and allowed parameters

Pin object

Name

Mandatory

type

Description

code

YES

Boolean

Set to true to create random code

allowed

YES

Boolean

Set to true if this user is allowed to start pin login, this will also be set under main tenant

Output


Response

SOAJS has a unified response. Check out this link to understand more the schema of SOAJS response 

 

Valid Response

{ result: true, data: { id: '%user_id%', tenant: { id: '%tenant_id%', code: '%tenant_code% } } }

 

Invalid Response

{ "result":false, "errors":{ "codes":[602], "details":[ { "code":602, "message":"Model error: + %model_error%" } ] } }

 

SOAJS Error Codes


Code

Description

Code

Description

535

Sub tenant cannot self invite a user

529

User has already been invited.

520

Unable to find user

525

Unable to generate pin at this time.

602

Model error: + %model_error%

527

username or id is required to invite user.



Â