Create a User
Creates a new user in your LeadSquared account.
FirstName, EmailAddress and Role are mandatory parameters.If you’re a sales group manager, you can use this API to create a new user and also add the user to your sales group. Just add the additional parameters to your JSON request –
"AssociatedGroups": [{
"GroupId": "022bc5d4-0fba-11e8-871e-02bf1924461c",
"ViewAllLeadsOfGroup": 1,
"ModifyAllLeadsOfGroup": 0,
"AddUsersToGroup": 0,
"ViewAllAccountsOfGroup": 0 ,
"ModifyAllAccountsOfGroup": 0
}]
API URL
Request
Content-Type: application/json{
"FirstName":"Chris",
"LastName":"Harris",
"EmailAddress":"charris@example.com",
"Role":"Sales_User",
"CustomFields":{
"Appraisal_Date":"2023-10-04",
"Lead_Assignment_Daily_Limit":"30",
"Marital_Status":"Single"
},
"AssociatedPhoneNumbers":"+91-8888888888",
"IsPhoneCallAgent":false,
"UserType":0,
"ManagerUserId":"0cd3c94b-acb5-11eb-9ad7-06f221480cd8",
"PhoneMobile":"",
"TimeZone":"",
"DateFormat":"",
"Password":"",
"TeamId":"",
"WorkDayTemplateId":"",
"HolidayCalendarId":""
}
Request Parameters
| Parameter | Description |
|---|---|
| FirstName | The user’s first name. This parameter is mandatory. |
| LastName | The user’s last name. |
| EmailAddress | The user’s email address. This parameter is mandatory. |
| Role | The user’s role. Accepted values include – Administrator, Marketing_User, Sales_Manager, Sales_User. This parameter is mandatory. |
| CustomFields | Pass the Schema Name and the value of the custom user fields you want to update. To obtain this, navigate to My Profile>Settings>Users and Permissions>User Fields. |
| AssociatedPhoneNumbers | Enter the phone number associated with the user. For example, +91-9876543210 |
| IsPhoneCallAgent | Pass true if you want the user to see the agent pop-up. Pass false if you don’t. |
| UserType | Pass 0 to create a web user. Pass 1 to create a mobile user. |
| ManagerUserId | You can use –
|
| PhoneMobile | Pass the user’s mobile phone number here. |
| TimeZone | Accepted values are – Pacific/Samoa, US/Hawaii, US/Alaska, US/Pacific, US/Arizona, Canada/Mountain, US/Mountain, America/Mexico_City, US/Central, America/Guatemala, Canada/Saskatchewan, US/East-Indiana, America/Bogota, US/Eastern America/Manaus, America/Caracas, America/Santiago, Canada/Atlantic, Canada/Newfoundland, America/Argentina/Buenos_Aires, America/Godthab, America/Bahia, Etc/GMT-2, Atlantic/Cape_Verde, Atlantic/Azores, Africa/Casablanca, Europe/London, Europe/Amsterdam, Africa/Algiers, Europe/Brussels, Europe/Sarajevo, Europe/Belgrade, Africa/Windhoek, Africa/Harare, Asia/Jerusalem, Europe/Athens, Europe/Kiev, Egypt, Europe/Minsk, Europe/Moscow, Africa/Nairobi, Asia/Baghdad, Asia/Kuwait, Asia/Tehran, Asia/Tbilisi, Asia/Baku, Asia/Yerevan, Asia/Muscat, Asia/Kabul, Asia/Karachi, Asia/Yekaterinburg, Asia/Kolkata, Asia/Katmandu, Asia/Colombo, Asia/Almaty, Asia/Dhaka, Asia/Rangoon, Asia/Bangkok, Asia/Krasnoyarsk, Australia/Perth, Asia/Taipei, Asia/Singapore, Asia/Irkutsk, Asia/Chongqing, Asia/Yakutsk, Asia/Tokyo, Asia/Seoul, Australia/Adelaide, Australia/Darwin, Pacific/Guam, Asia/Vladivostok, Australia/Hobart, Australia/Brisbane, Australia/Canberra, Asia/Magadan, Pacific/Auckland, Pacific/Fiji, Pacific/Tongatapu |
| DateFormat | Accepted date formats are – mm/dd/yy
mm/dd/yyyy dd/mm/yy dd/mm/yyyy
|
| Password | You can set a password for the user. |
| TeamId | The Id of the team you want to add the user to. You can use the Get Teams API to retrieve the team Id. Note: If this parameter is not passed, the user will be assigned to the root team in your account. |
| WorkDayTemplateId | The Id of the work day template you want to assign to the user’s team. Use the Get Teams API to retrieve the work day template Id. Note: If passed, the work day template will be overridden for the user. |
| HolidayCalendarId | The Id of the holiday calendar you want to assign to the user’s team. Use the Get Teams API to retrieve the holiday Id. Note: If passed, the holiday calendar will be overridden for the user. |
Response
{
"Status": "Success",
"Message": {
"Id": "b3d4098f-fd15-11e8-ae3d-020714094d7e"
}
}
HTTP Response Codes
| Code | Description |
|---|---|
| 200 OK | This is the status code for successful API call. |
| 401 Unauthorized | The API call was made with invalid access credentials. Check your AccessKey and SecretKey. |
| 400 Bad Request | The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure. |
| 404 Not Found | The API could not be found. Please check the API signature. |
| 429 Too Many Requests | API calls exceeded the limit of 25 in 5 second(s) |
| 500 Internal Server Error | The API called failed. There could be many reasons for it. Check the exception message to get more details. |


