LeadSquared Developer Centre

ON THIS PAGE

Create Tasks in Bulk


This API lets you add up to 50 tasks in bulk to your users.

Note:

  • You can pass both Appointments and To-do task types in the same API.
  • To post the data to a URL of your choice, use the StatusWebhookURL parameter.
  • You can download the report of the tasks created from the Request History page. This report will also be emailed to your registered email Id.
  • The DueDate and EndDate parameters are optional. If you don’t pass them, the due date will be taken as the current day and the appointment will be created with the default duration specified in the task type configuration.

API URL

URL
Icon
POST https://{host}/v2/Task.svc/Bulk/Create?accessKey=AccessKey&secretKey=SecretKey

Request

Content-Type: application/json
JSON Body/Payload Icon
{
   "TaskList":[
      {
         "Name":"Meeting",
         "Description":"Meeting with Adam",
         "RelatedEntity":1,
         "RelatedEntityId":"7e5b7380-4295-4af2-9706-941ab71be772",
         "DueDate":"2021-11-25 13:10:00",
         "EndDate":"2021-11-25 13:15:00",
         "Reminder":30,
         "NotifyBy":"1100",
         "OwnerEmailAddress":"sri@example.com",
         "Location":"Koramangala",
         "TaskType":{
            "Name":"Meeting"
         },
         "CustomFields":{
            "mx_Custom_1":"Meeting in Koramangala"
         }
      },
      {
         "Name":"Document Collection",
         "Description":"Collect KYC documents",
         "RelatedEntity":0,
         "RelatedEntityId":"",
         "DueDate":"2021-11-27 13:10:00",
         "EndDate":"2021-11-27 13:15:00",
         "Reminder":45,
         "NotifyBy":"1000",
         "OwnerEmailAddress":"vir@example.com",
         "TaskType":{
            "Name":"Document Collection"
         },
         "CustomFields":{
            "mx_Custom_1":"None"
         }
      }
   ],
   "StatusWebhookURL":"https://webhook.site/5f51ba29-ca49-405d-ac10-587bbc7647d4"
}

Request Parameters

Parameter Description
Name

Name of the task. You may pass any string value here.

Description

Description of the task.

RelatedEntity

Pass “1” if you’re passing the LeadId.

Pass “5” if you’re passing the OpportunityId.

Pass “0” if you’re not passing any value.

RelatedEntityId

The LeadId or OpportunityId you want to associate the task with.

To obtain the LeadId, refer to any of the Get Lead APIs.

To obtain the OpportunityId, refer to Get Opportunities by Lead Id.

DueDate

Due date of task in the “yyyy-mm-dd hh:mm:ss” format.

EndDate

The end date of the task in the “yyyy-mm-dd hh:mm:ss” format. The task will remain ‘Pending’ until the end date, after which it will become ‘Overdue’.

Reminder

Let’s you set a reminder in minutes. An email notification will be sent to the task owner before the due time based on this setting.

NotifyBy

Set the value as 1100 if you want the task owner to be notified by email.

Set the value as 1000 if you don’t want any notifications.

OwnerEmailAddress

Email address of the user to whom you’re assigning the task.

Location

The geographic location where the task is due (e.g., Koramangala, etc.). This is a string field.

CustomFields

The custom task type fields that you want to pass (e.g., “mx_Custom_1”).

StatusWebhookURL

Pass the webhook URL to which you want to post the data.

Response

200 OK
Content-Type: application/json
{
   "Status":"Success",
   "Message":{
      "Id":"1556275384"
   }
}

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.

On this page

© 2022 by MarketXpander Services Pvt Ltd. All Rights Reserved.