Create User

URL :v3/user/create/api

HTTP Method : POST

Response Format: JSON

Parameters:

Parameter Data Type Optional/Required Description
first_name String Required It’s the first name of the user
last_name String Required It’s the last name of the user
user_name String Configurable It’s the user name of the user and it’s configurable from backend form settings
phone_number String Configurable It’s the work phone no of the user and it’s configurable from backend form settings
email String Configurable It’s the email id of the user and it’s configurable from backend form settings
mobile String Configurable It’s the mobile phone no of the user and it’s configurable from backend form settings
custom_id String/Array Optional “custom_(id of the custom field)”
organisation[0] array Optional “Id of the Organisation”
organisation_department[0] array Optional “Id of the Organisation Department”
related[0]{‘org_id’:org_id,’org_dept’:org_dept} array of objects Optional “Id of the Organisation and Organization Department”
Note – if “organisation_department” is passed while making request then it is mandatory to pass “related” data. No of element’s inside “organisation_department” array should be equal with no of element’s inside “related” array. Now onwords user can have multiple organization and organization department so in order to keep track, which departments is related to which organization in “related” array, array of elements passed as combination of organization id and organization department id.

Response

  • Response Format: JSON
  • Returns JSON which contains below response

Sample JSON Success Response :

 

{

"success": true,

"message": "New user sucessfully created",

"data": {

"first_name": "Demo",

"last_name": "User",

"email": "demouser@gmail.com",

"mobile": "123456789",

"user_name": "user",

"role": "user",

"email_verify": "tyf0woROJhbh3gtLw5sHbdxlmOhTqnDnH8KAhkq6kApKOuYYZXAi5gug3Dvx",

"mobile_otp_verify": "tyf0woROJhbh3gtLw5sHbdxlmOhTqnDnH8KAhkq6kApKOuYYZXAi5gug3Dvx",

"agent_tzone": 33,

"updated_at": "2020-06-03 15:13:26",

"created_at": "2020-06-03 15:13:25",

"id": 6,

"phone_number": "123456789",

"internal_note": null,

"full_name": "Demo User",

"meta_name": "Demo User <demouser@gmail.com>"

}

}

 

 

Possible Errors/Failures:

 

{

"success":false,

"message":{

"field":"this field is required"

}

}

 

{

"success": false,

"message": {

"email": "This email/username has already been taken",

"user_name": "This email/username has already been taken",

"mobile_phone": "The mobile phone has already been taken."

}

}