Create a Team

Lets you create a new team in your LeadSquared account. It is mandatory to pass the “Name” parameter. All other parameters are optional.

 

API URL

POST
https://{host}/v2/TeamManagement.svc/Create?accessKey=AccessKey&secretKey=SecretKey
Copy URL

Request

JSON Body/Payload

Content-Type: application/json

{ 
   "Name":"India",
   "Description":"Sales Team in India",
   "Sequence":0,
   "ParentCode":237,
   "WorkdayTemplateCode":0,
   "HolidayCalendarCode":0,
   "SmartViewCode":0
}

JSON Properties

Parameter Description
Name

Enter the name of the team. This parameter is mandatory.

Description

Enter a description of the team.

Sequence

Decides the position of the team under the parent team.

Note: The value passed cannot be less than 0. It also cannot be more than the maximum sequence in the node + 1.

ParentCode

Lets you assign the team to a parent team.

The code is available on the teams grid  (Navigate to My Profile>Settings>Users and Permissions>Teams)

teams code

Note: If you don’t pass this parameter, the new team will be assigned to the root team in your account.

WorkDayTemplateCode

Assigns a work day template to the team.

The code is available on the work day template grid (Navigate to My Profile>Settings>Users and Permissions>Work Day Templates)

workday template code

Note: If you don’t pass this parameter, the new team will inherit the work day template assigned to the parent team.

HolidayCalendarCode

Assigns a holiday calendar to the team.

The code is available on the holiday calendar grid (Navigate to My Profile>Settings>Users and Permissions>Holiday Calendar)

Holiday calendar code

Note: If you don’t pass this parameter, the new team will inherit the holiday calendar assigned to the parent team.

SmartViewCode

Assigns a Smart View to the team.

The code is available on the smart views grid (Navigate to My Profile>Settings>Customization>Smart Views)

smart views code

Note: If you don’t pass this parameter, the new team will inherit the smart views assigned to the parent team.

Response

200 OK

Content-Type: application/json

{ 
   "Status":"Success",
   "Message":{ 
      "Id":"3acee002-ee4f-11e9-aebf-02b00a4d022c",
      "IsSuccessful":true,
      "Code":8
   }
}

HTTP Response Code

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.