Integrate LeadSquared CRM into the workflow. Create, update, upsert, look up, and search leads, change a lead owner or stage, log AI call and WhatsApp outcomes as activities, read a lead activity history, create and list follow-up tasks, add notes, and capture or update opportunities. Can also run workflows when LeadSquared posts a webhook. Requires a LeadSquared access key, secret key, and the API host of your region.
Get one lead by its lead ID, email address, or phone number. Returns found=false when no lead matches.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
lookupBy | string | Yes | How to find the lead: "id", "email", or "phone" |
leadId | string | No | Lead ID (ProspectID), when looking up by id |
emailAddress | string | No | Email address, when looking up by email |
phone | string | No | Phone number, when looking up by phone. With or without country code, but no spaces or hyphens. |
| Parameter | Type | Description |
|---|
leadId | string | Lead ID (ProspectID) |
firstName | string | First name |
lastName | string | Last name |
emailAddress | string | Email address |
phone | string | Phone number |
mobile | string | Mobile number |
stage | string | Lead stage (ProspectStage) |
ownerId | string | User ID of the lead owner |
ownerName | string | Name of the lead owner |
ownerEmailAddress | string | Email address of the lead owner |
source | string | Lead source |
score | number | Lead score |
engagementScore | number | Engagement score |
createdOn | string | Created time (UTC) |
modifiedOn | string | Last modified time (UTC) |
record | json | Every field LeadSquared returned for the lead, keyed by schema name (mx_ custom fields included) |
found | boolean | Whether a matching lead was found |
Find leads with a quick search across name, email, phone, company, city, and country, or by a field criterion such as CreatedOn > 2026-01-01 or ProspectStage = Prospect.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
searchMode | string | Yes | "quick" for a quick search, or "criteria" to match one field with an operator |
quickSearchKey | string | No | Text to quick search for, e.g. a name, email, or phone number |
lookupName | string | No | Criteria search: schema name of the field to match, e.g. "ProspectStage" |
lookupValue | string | No | Criteria search: value to compare with. Dates use "yyyy-MM-dd HH:mm:ss" in UTC. |
sqlOperator | string | No | Criteria search: one of =, LIKE, >, <, <=, >=, <> (default =) |
columns | string | No | Criteria search: comma-separated schema names to return. Defaults to the standard contact, stage, and owner fields. |
sortColumn | string | No | Criteria search: schema name to sort by, e.g. "CreatedOn" |
sortDirection | string | No | Criteria search: "desc" (default) or "asc" |
pageIndex | number | No | Criteria search: page number, starting at 1 |
pageSize | number | No | Criteria search: leads per page (default 25, max 1000) |
| Parameter | Type | Description |
|---|
leads | array | Matching leads. A criteria search fills only the requested columns. |
↳ leadId | string | Lead ID (ProspectID) |
↳ firstName | string | First name |
↳ lastName | string | Last name |
↳ emailAddress | string | Email address |
↳ phone | string | Phone number |
↳ mobile | string | Mobile number |
↳ stage | string | Lead stage (ProspectStage) |
↳ ownerId | string | User ID of the lead owner |
↳ ownerName | string | Name of the lead owner |
↳ ownerEmailAddress | string | Email address of the lead owner |
↳ source | string | Lead source |
↳ score | number | Lead score |
↳ engagementScore | number | Engagement score |
↳ createdOn | string | Created time (UTC) |
↳ modifiedOn | string | Last modified time (UTC) |
↳ record | json | Every field LeadSquared returned for the lead, keyed by schema name (mx_ custom fields included) |
count | number | Number of leads returned on this page |
Create a new lead in LeadSquared. Pass at least one of FirstName, LastName, EmailAddress, or Phone; EmailAddress and Phone are unique by default, so creating a duplicate fails.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
fields | json | No | Lead fields as a JSON object keyed by schema name, e.g. {"FirstName": "Asha", "EmailAddress": "asha@example.com", "Phone": "+91-9876543210", "mx_City": "Pune"}. A nested object sets a custom field set. |
ownerId | string | No | User ID to assign as the lead owner (sets the OwnerId field) |
stage | string | No | Lead stage to set, e.g. "Prospect" or "Customer" (sets the ProspectStage field) |
| Parameter | Type | Description |
|---|
leadId | string | ID (ProspectID) of the new lead |
Update fields on an existing lead by its lead ID, including changing the lead owner or stage. Only the fields you pass change.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
leadId | string | Yes | ID (ProspectID) of the lead to update |
fields | json | No | Lead fields as a JSON object keyed by schema name, e.g. {"FirstName": "Asha", "EmailAddress": "asha@example.com", "Phone": "+91-9876543210", "mx_City": "Pune"}. A nested object sets a custom field set. |
ownerId | string | No | User ID to assign as the lead owner (sets the OwnerId field) |
stage | string | No | Lead stage to set, e.g. "Prospect" or "Customer" (sets the ProspectStage field) |
postUpdatedLead | boolean | No | Run the automations, webhooks, and notifications configured for lead updates. LeadSquared skips them for API updates unless this is on. |
| Parameter | Type | Description |
|---|
affectedRows | number | Number of leads updated |
Update the lead that matches the email address or phone (or the Search By field), or create a new lead when none matches.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
fields | json | No | Lead fields as a JSON object keyed by schema name, e.g. {"FirstName": "Asha", "EmailAddress": "asha@example.com", "Phone": "+91-9876543210", "mx_City": "Pune"}. A nested object sets a custom field set. |
ownerId | string | No | User ID to assign as the lead owner (sets the OwnerId field) |
stage | string | No | Lead stage to set, e.g. "Prospect" or "Customer" (sets the ProspectStage field) |
searchBy | string | No | Schema name of the field to match an existing lead on, e.g. "EmailAddress" or "Phone". Defaults to email address and phone. |
postUpdatedLead | boolean | No | Run the automations, webhooks, and notifications configured for lead updates |
| Parameter | Type | Description |
|---|
leadId | string | ID (ProspectID) of the lead that was created or updated |
affectedRows | number | Number of leads affected |
Post an activity on a lead, such as the outcome of an AI call or a WhatsApp conversation, with a note and custom activity fields. Find the activity event code under My Account > Settings > Customization > Custom Activities & Scores.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
leadId | string | Yes | ID (ProspectID) of the lead to post the activity on |
activityEvent | number | Yes | Activity event code of the activity type, e.g. 201 for a custom activity |
activityNote | string | No | Activity note, e.g. a call summary or the conversation outcome |
activityDateTime | string | No | When the activity happened, in UTC as "yyyy-MM-dd HH:mm:ss". Defaults to now. |
activityFields | json | No | Custom activity fields as a JSON object keyed by schema name, e.g. {"mx_Custom_1": "Interested", "mx_Custom_2": "180"} |
| Parameter | Type | Description |
|---|
id | string | ID of the new activity |
List the activities on a lead, optionally only one activity type, with each activity note and custom field values. Returns 25 activities unless a row count is set.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
leadId | string | Yes | ID (ProspectID) of the lead |
activityEvent | number | No | Only return activities with this event code. Leave empty for all activities. |
offset | number | No | Page offset (default 0) |
rowCount | number | No | Activities per page (default 25) |
| Parameter | Type | Description |
|---|
recordCount | number | Total activities matching the filter |
activities | array | Activities on the lead |
↳ activityId | string | Activity ID |
↳ eventCode | number | Activity event code |
↳ eventName | string | Activity type name |
↳ activityScore | number | Score of the activity |
↳ createdOn | string | Created time (UTC) |
↳ modifiedOn | string | Last modified time (UTC) |
↳ activityType | number | Activity type code |
↳ type | string | Direction, e.g. Inbound |
↳ leadId | string | ID of the lead |
↳ data | json | Activity properties keyed by name, e.g. CreatedByName, NotableEventDescription (the note), HasAttachments |
↳ fields | json | Non-empty custom activity fields keyed by schema name |
Create an appointment or to-do task, such as a callback, on a lead or an opportunity and assign it to a user. The task type name decides whether it is an appointment or a to-do.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
name | string | Yes | Task subject, e.g. "Call back about the loan offer" |
taskType | string | Yes | Name of a task type configured in LeadSquared, e.g. "Meeting" or "Follow Up" |
relatedEntity | string | No | What the task is about: "lead" (default), "opportunity", or "none" |
relatedEntityId | string | No | Lead ID or opportunity ID the task is about |
description | string | No | Task description |
dueDate | string | No | Due date in UTC as "yyyy-MM-dd HH:mm:ss". Defaults to today. |
endDate | string | No | End date in UTC as "yyyy-MM-dd HH:mm:ss". The task turns overdue after it. |
ownerId | string | No | User ID to assign the task to |
ownerEmailAddress | string | No | Email of the user to assign the task to, when the user ID is not known |
reminder | number | No | Appointments: minutes before the due time to remind the owner |
reminderBeforeDays | number | No | To-dos: days before the due date to remind the owner |
reminderTime | string | No | To-dos: time of day for the reminder, as "hh:mm:ss" |
notifyByEmail | boolean | No | Email the task owner about the task |
| Parameter | Type | Description |
|---|
id | string | ID of the new task |
List the tasks on a lead, or the tasks assigned to a user with optional date range and completion filters.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
taskLookupBy | string | Yes | "lead" for the tasks on one lead, or "owner" for the tasks assigned to a user |
leadId | string | No | Lead ID (ProspectID), when listing tasks on a lead |
ownerId | string | No | User ID of the task owner, when listing by owner |
ownerEmailAddress | string | No | Email of the task owner, when listing by owner and the user ID is not known |
fromDate | string | No | Owner lookup: only tasks from this UTC time ("yyyy-MM-dd HH:mm:ss") |
toDate | string | No | Owner lookup: only tasks up to this UTC time ("yyyy-MM-dd HH:mm:ss") |
taskStatus | string | No | Owner lookup: "incomplete", "complete", or "any" (default) |
offset | number | No | Owner lookup: number of tasks to skip (default 0) |
rowCount | number | No | Owner lookup: number of tasks to return (default 50) |
| Parameter | Type | Description |
|---|
recordCount | number | Total matching tasks |
tasks | array | Matching tasks |
↳ taskId | string | Task ID |
↳ name | string | Task subject |
↳ description | string | Task description |
↳ dueDate | string | Due date (UTC) |
↳ endDate | string | End date (UTC), owner lookups only |
↳ status | string | Task status, e.g. Pending, for lead lookups; Incomplete or Complete for owner lookups |
↳ ownerId | string | User ID of the owner |
↳ ownerName | string | Name of the owner |
↳ ownerEmailAddress | string | Email of the owner, owner lookups only |
↳ createdBy | string | User ID of the creator |
↳ createdByName | string | Name of the creator |
↳ createdOn | string | Created time (UTC) |
↳ reminder | number | Reminder in minutes |
↳ taskTypeName | string | Task type name, owner lookups only |
Add a note to a lead, optionally with an attachment URL.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
leadId | string | Yes | ID (ProspectID) of the lead |
note | string | Yes | Note text |
attachmentUrl | string | No | URL of a file to attach to the note |
| Parameter | Type | Description |
|---|
id | string | ID of the new note |
Capture an opportunity on a lead, creating the lead too when no lead matches. Duplicate detection rules may attach it to an existing opportunity instead of creating a new one.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
opportunityEventCode | number | Yes | Event code of the opportunity type, from Settings > Opportunities > Opportunity Types, e.g. 12000 |
leadId | string | No | ID (ProspectID) of an existing lead. Use this or Lead Fields. |
leadFields | json | No | Unique lead fields to find or create the lead, as a JSON object, e.g. {"EmailAddress": "asha@example.com"} |
searchBy | string | No | Schema name of the lead field to match on, e.g. "EmailAddress" or "Phone". Defaults to the first lead field. |
opportunityNote | string | No | Note on the opportunity |
opportunityDateTime | string | No | Opportunity date in UTC as "yyyy-MM-dd HH:mm:ss" |
opportunityFields | json | No | Opportunity fields as a JSON object keyed by schema name, e.g. {"mx_Custom_1": "Home loan", "Status": "Open"} |
overwriteFields | boolean | No | Overwrite the fields of a duplicate opportunity with the values passed |
updateEmptyFields | boolean | No | Fill empty fields of a duplicate opportunity with the values passed |
doNotPostDuplicateActivity | boolean | No | Do not post a duplicate-detected activity on the opportunity |
doNotChangeOwner | boolean | No | Keep the current owner of a duplicate opportunity |
| Parameter | Type | Description |
|---|
opportunityId | string | ID of the new opportunity, null when a duplicate was detected |
leadId | string | ID of the lead the opportunity is on |
activityId | string | ID of the opportunity captured activity |
isUnique | boolean | False when the opportunity matched an existing one |
conflictedOpportunityId | string | ID of the existing opportunity matched as a duplicate |
status | number | 0 success, 2 partial success (secondary action failed) |
primaryAction | number | 0 none, 1 create opportunity, 2 opportunity captured activity, 3 duplicate detected activity |
secondaryAction | number | Second action taken, with the same codes as primaryAction |
requestId | string | LeadSquared request ID |
Update fields or the note of an existing opportunity by its opportunity ID. Only the fields you pass change.
| Parameter | Type | Required | Description |
|---|
apiHost | string | Yes | Regional API host of the account, e.g. "api-in21.leadsquared.com" (Mumbai). Shown under My Account > Settings > API and Webhooks. |
accessKey | string | Yes | LeadSquared access key, from My Account > Settings > API and Webhooks |
secretKey | string | Yes | LeadSquared secret key, from My Account > Settings > API and Webhooks |
opportunityId | string | Yes | ID of the opportunity (ProspectOpportunityId), or its AutoId value |
opportunityNote | string | No | Note on the opportunity |
opportunityFields | json | No | Opportunity fields to change, as a JSON object keyed by schema name, e.g. {"Status": "Won", "mx_Custom_7": "200000"} |
| Parameter | Type | Description |
|---|
id | string | ID LeadSquared returns for the update (Message.Id) |