Connect Retool to LeadSquared using a REST API Resource with your LeadSquared Access Key and Secret Key as query parameters. LeadSquared's API provides endpoints for lead management, activity tracking, email campaigns, and lead scoring. Build a sales team CRM panel in Retool for lead qualification, pipeline tracking, and follow-up management — faster than navigating LeadSquared's native interface.
| Fact | Value |
|---|---|
| Tool | LeadSquared |
| Category | Marketing |
| Method | REST API Resource |
| Difficulty | Intermediate |
| Time required | 25 minutes |
| Last updated | April 2026 |
Build a LeadSquared Lead Management and Sales Pipeline Panel in Retool
LeadSquared is a high-velocity CRM widely used by sales teams in education, real estate, healthcare, and financial services — particularly across South Asia and emerging markets. Its native interface is feature-rich but can be slow for teams that need to quickly qualify a high volume of leads, view lead scoring distributions, or cross-reference pipeline data with activity logs. Retool provides a faster, purpose-built sales operations panel by connecting to LeadSquared's comprehensive REST API.
With a Retool-LeadSquared integration, you can build a lead qualification dashboard that surfaces all new leads with their scores, source, and last activity in a prioritized list for sales reps to work through efficiently. A pipeline stage view can show leads by stage with filters for owner, date, and lead quality score — making it easy for sales managers to identify stalled opportunities. An activity tracking panel can display the full interaction history for a selected lead (emails sent, calls made, website visits, form fills) from a single Retool view rather than navigating multiple tabs in LeadSquared.
LeadSquared's API is organized around Leads, Activities, Opportunities, Emails, and Lists. The access key and secret key authentication is straightforward — passed as query parameters on every request. The API returns responses in a consistent structure with status codes and data payloads, though some endpoints use different response shapes that require careful transformer handling. LeadSquared has region-specific API endpoints (India, US, and other regions) — use the correct base URL for your account's region.
Integration method
LeadSquared's REST API uses access key and secret key authentication passed as query parameters (accessKey and secretKey) on every request. The API base URL includes your LeadSquared host subdomain (e.g., api.leadsquared.com for the standard region, or a region-specific subdomain). In Retool, you configure a REST API Resource with the LeadSquared API base URL and default query parameters for authentication. Retool proxies all requests server-side, so credentials never reach the browser and CORS is not an issue.
Prerequisites
- A LeadSquared account with API access (typically available on Standard, Enterprise, and higher plans)
- Your LeadSquared Access Key and Secret Key (found in LeadSquared Settings → API & Webhooks)
- Your LeadSquared API host URL (region-specific, e.g., api.leadsquared.com for the standard region)
- A Retool account with permission to create Resources
- Basic familiarity with Retool's Query Editor and REST API Resource configuration
Step-by-step guide
Locate your LeadSquared API credentials
Log in to your LeadSquared account. Navigate to Settings by clicking the gear icon or your profile in the top-right corner and selecting Settings. In the Settings menu, look for the 'API & Webhooks' or 'Developer' section in the left sidebar — the exact label may vary slightly by LeadSquared version. On the API settings page, you will find two key credentials: the Access Key (a shorter alphanumeric identifier) and the Secret Key (a longer alphanumeric secret). Both are required for every API request. Copy both values and store them securely. Also note your API host URL on this page — LeadSquared uses region-specific API endpoints. The standard URL for most accounts is https://api.leadsquared.com, but accounts in India (IN region) may use https://api.in21.leadsquared.com or a similar regional subdomain. This host URL forms the base of your Retool resource configuration. The access key and secret key are passed as query parameters (not headers) on every API request: ?accessKey=YOUR_KEY&secretKey=YOUR_SECRET. This is important to note because Retool handles header-based auth differently from query-parameter-based auth — you will configure these as default URL parameters in the Resource.
Pro tip: LeadSquared's API keys do not expire automatically, but they can be regenerated from the same Settings → API & Webhooks page if you suspect a key has been compromised. Regenerating a key immediately invalidates the old one, so update your Retool Configuration Variables promptly after regeneration.
Expected result: You have your LeadSquared Access Key, Secret Key, and API host URL copied and ready for Retool configuration.
Create the LeadSquared REST API Resource in Retool
In Retool, navigate to the Resources tab in the left sidebar and click Add Resource. Select REST API from the resource type list. Name the resource 'LeadSquared'. In the Base URL field, enter your LeadSquared API host URL in the format https://api.leadsquared.com — substitute the regional variant if your account uses a different host. Do not include a trailing slash. Scroll to the URL Parameters section (not Headers — LeadSquared uses query parameters for auth). Add two default URL parameters that will be appended to every query automatically. First parameter: key set to 'accessKey' and value set to your LeadSquared Access Key. Second parameter: key set to 'secretKey' and value set to your LeadSquared Secret Key. These parameters will be sent on every request to the resource without needing to include them in individual query configurations. Alternatively, if you prefer to use Retool's Configuration Variables (more secure — recommended), store the keys as config vars named LEADSQUARED_ACCESS_KEY and LEADSQUARED_SECRET_KEY, then set the URL parameter values to {{ retoolContext.configVars.LEADSQUARED_ACCESS_KEY }} and {{ retoolContext.configVars.LEADSQUARED_SECRET_KEY }} respectively. Add a Content-Type header with value application/json for POST request bodies. Click Save Changes. To verify the configuration, create a test query with GET method and path /v2/LeadManagement.svc/Leads.Get?fetchSize=5 — a successful response returns the first 5 leads in your account.
Pro tip: Rather than embedding Access Key and Secret Key directly in the Resource URL Parameters, use Retool Configuration Variables (Settings → Configuration Variables, mark both as secrets). This prevents credentials from being visible to all workspace members who can see Resource configurations, while still allowing them to be used in queries without knowing the actual values.
Expected result: The LeadSquared resource appears in the Resources list. A test GET query returns lead data, confirming authentication parameters are correctly configured.
Query leads with search and filtering
Create a new query named 'getLeads' in your Retool app's Code panel. Select your LeadSquared resource. Set Method to GET and Path to /v2/LeadManagement.svc/Leads.Get. LeadSquared's lead retrieval endpoint supports filtering via URL parameters. In the URL Parameters section of the query, add: 'fetchSize' set to {{ pagination.pageSize || 25 }} for results per page, 'pageIndex' set to {{ pagination.page - 1 || 0 }} for zero-indexed pagination, and optionally 'score_min' bound to {{ scoreFilter.minValue || 0 }} and 'score_max' bound to {{ scoreFilter.maxValue || 100 }} for score-based filtering. For more specific filtering, LeadSquared uses a different approach: the SearchLeads endpoint at /v2/LeadManagement.svc/Leads.GetByField requires a JSON body with the search criteria. Create a separate query named 'searchLeads' for this purpose with POST method, Path /v2/LeadManagement.svc/Leads.GetByField, Body Type JSON, and a body containing the search field and value. LeadSquared's API returns lead data in a different structure than typical REST APIs — responses include a Status field ('Success' or 'Error') and a Leads array (for list endpoints) or a Lead object (for single record endpoints). Add a transformer to check the Status field and extract the Leads array, mapping each lead to table-friendly fields.
1// Transformer: flatten LeadSquared leads response2if (data.Status !== 'Success') {3 console.log('LeadSquared API error:', data.Message || data.Status);4 return [];5}6const leads = data.Leads || data.Lead || [];7const leadsArray = Array.isArray(leads) ? leads : [leads];8return leadsArray.map(lead => {9 const attrs = {};10 (lead.LeadPropertyList || []).forEach(prop => {11 attrs[prop.Attribute] = prop.Value;12 });13 return {14 id: lead.LeadId || attrs.LeadId || '',15 name: attrs.FirstName ? `${attrs.FirstName} ${attrs.LastName || ''}`.trim() : attrs.Email,16 email: attrs.EmailAddress || attrs.Email || '',17 phone: attrs.Phone || attrs.Mobile || '',18 source: attrs.Source || '',19 stage: attrs.LeadStage || '',20 score: parseInt(attrs.LeadScore || '0'),21 owner: attrs.OwnerId || '',22 created: attrs.CreatedOn ? new Date(attrs.CreatedOn).toLocaleDateString() : '',23 last_activity: attrs.LastActivityDate ? new Date(attrs.LastActivityDate).toLocaleDateString() : 'None'24 };25});Pro tip: LeadSquared represents lead attributes as a LeadPropertyList array of {Attribute, Value} pairs rather than flat object fields. Always extract values using the forEach pattern shown in the transformer — attempting to access lead.EmailAddress directly will return undefined since the value lives inside the property array.
Expected result: The getLeads query returns a table-friendly array of lead objects with name, email, stage, score, and activity date visible in the Results panel.
Build the lead management dashboard UI
In the Retool canvas, add a metrics row at the top with three Statistic components: Total Leads (count from getLeads.data), Average Lead Score (computed average), and Leads with No Activity in 7+ Days (filtered count). Below metrics, add filter controls: a Select for lead stage (populated by a query to GET /v2/LeadManagement.svc/LeadStages.Get), a Select for owner/rep (populated by a users query), and a Range Slider for score filtering (0-100, named 'scoreFilter'). Add a Table component bound to {{ getLeads.data }} with columns configured as: name, email, phone, source, stage (with conditional formatting for color — green for hot stages, yellow for nurture, gray for unqualified), score (numeric with bar visualization), owner, last_activity. Sort the default view by score descending so highest-priority leads appear first. Create a lead detail side panel: when a table row is selected, load the full lead record using a query named 'getLeadDetail' at GET /v2/LeadManagement.svc/Leads.GetById?Id={{ leadsTable.selectedRow.id }}. Show the lead's complete attribute list in the detail panel using Retool's Key-Value component. Below the key-value display, add a Log Activity form with a Select for activity type (Call, Email, Note, Appointment), a Multiline Text Input for notes, and a Submit button that posts to LeadSquared's activity creation endpoint. Add a stage progression button that fires a PATCH or PUT request to update the lead's stage.
1// POST body for Log Activity query2{3 "LeadId": "{{ leadsTable.selectedRow.id }}",4 "Activity": {5 "ActivityEvent": 206,6 "ActivityNote": "{{ activityNote.value }}",7 "ActivityType": "{{ activityType.value }}"8 }9}Pro tip: LeadSquared uses numeric activity event codes (e.g., 206 for a phone call, 212 for an email sent) rather than plain text type names. Query GET /v2/LeadManagement.svc/ActivityTypes.GetAll to retrieve all activity types and their codes, then use these to build the activityType Select dropdown dynamically rather than hardcoding event codes.
Expected result: A functional lead management dashboard shows prioritized leads with score-based sorting, a detail panel with full lead history, and an activity logging form.
Add activity timeline and pipeline analytics views
Create a query named 'getLeadActivities' with GET method and path /v2/ProspectActivity.svc/GetAll?leadId={{ leadsTable.selectedRow.id }}&pageIndex=0&pageSize=50. This returns all activities logged for the selected lead in reverse chronological order — including emails, calls, form submissions, website visits, and manual notes. Add a transformer to extract activity type, date, note content, and the user who performed the action into table rows. Display this in a Timeline-style Table component within the lead detail panel, sorted by date descending. For pipeline analytics, create a query named 'getPipelineStats' that fetches opportunities or leads grouped by stage. Use a POST to /v2/LeadManagement.svc/Leads.GetByStages or a similar analytics endpoint, or use the Leads.Get endpoint with stage filter and combine multiple queries with different stage values using a JavaScript query that calls all stage queries in parallel and merges results. Display the pipeline data as a Funnel or Bar Chart showing lead count and total value by stage. Add a date range filter to scope the pipeline view to leads created within a specific period. Build a Tab component with three tabs: Leads (the main management table), Activity (for the selected lead's timeline), and Pipeline (for the funnel chart). For complex multi-team LeadSquared deployments with custom fields, lead scoring rules, and automated activity Workflows, RapidDev's team can help architect your Retool sales operations solution.
1// Transformer: flatten LeadSquared activities response2if (data.Status !== 'Success') return [];3const activities = data.ProspectActivities || [];4return activities.map(activity => ({5 id: activity.Id,6 type: activity.ActivityType || 'Activity',7 date: activity.ActivityDate ? new Date(activity.ActivityDate).toLocaleString() : '',8 note: activity.ActivityNote || '',9 event_code: activity.ActivityEvent || 0,10 performed_by: activity.PerformedByUserId || '',11 related_to: activity.RelatedEntityName || ''12}));Pro tip: LeadSquared's lead scoring updates asynchronously — after logging activities or updating fields, the score shown in the lead record may take a few minutes to reflect the new calculation. Avoid building real-time score dashboards that assume instant score updates; instead, refresh score data every 5-10 minutes using a cached query interval.
Expected result: The app has three tabs for Lead Management, Activity Timeline, and Pipeline Analytics, with data flowing from LeadSquared's API into each view.
Common use cases
Build a lead qualification and scoring dashboard
Create a Retool lead management panel that shows all new and uncontacted leads sorted by lead score — helping sales reps prioritize their outreach efforts based on LeadSquared's AI-driven scoring. Display lead name, email, phone, source (Facebook Ads, webinar, organic), score, and the time since they were last contacted. Enable one-click stage progression and activity logging directly from the Retool interface.
Build a Retool lead qualification dashboard querying LeadSquared's lead retrieval API. Show a Table sorted by lead score (descending) with columns for name, email, phone, source, score, stage, owner, and hours since last activity. Include filters for stage, owner, source, and score range. Add a Log Activity button that posts a call or note activity to the selected lead.
Copy this prompt to try it in Retool
Build a sales pipeline and opportunity tracker
Create a Retool opportunity pipeline dashboard that shows all active LeadSquared opportunities grouped by stage, with total pipeline value by stage and average days spent in each stage. Enable sales managers to reassign opportunities to different reps, update expected close dates, and move deals between stages without opening LeadSquared for each individual record.
Build a Retool pipeline panel querying LeadSquared's opportunities API. Show a Table with opportunity title, associated lead name, stage, expected close date, opportunity value, owner, and days in current stage. Include summary metrics for total pipeline value and count by stage. Add a Change Stage button and Owner Reassign dropdown per row.
Copy this prompt to try it in Retool
Build a lead activity history and engagement panel
Create a Retool lead detail panel that shows the complete activity timeline for a selected lead — all emails sent, calls made, webinar registrations, website visits, form submissions, and manual notes logged by the sales team. This full-context view helps sales reps understand the lead's engagement history before making contact, improving call quality and conversion rates.
Build a Retool lead detail panel. After selecting a lead from a Table, query LeadSquared's lead activities endpoint to show the full activity timeline — activity type, date, description, and who performed the action. Sort by date descending. Include a Log Activity form with type selector (Call, Email, Note) and description text input.
Copy this prompt to try it in Retool
Troubleshooting
API returns 'Invalid API credentials' or Status: 'Error' with authentication message
Cause: The accessKey or secretKey query parameters are missing, incorrect, or using the wrong regional API host URL. LeadSquared requires both credentials on every request, and accounts in different regions must use region-specific API base URLs.
Solution: Verify both accessKey and secretKey are configured as default URL parameters in your Retool Resource settings. Double-check the API host URL — India-region accounts often use a different subdomain (e.g., api.in21.leadsquared.com). Navigate to LeadSquared Settings → API & Webhooks and confirm both the credentials and the correct API URL for your account's region.
Lead data returns blank name fields even though names exist in LeadSquared
Cause: LeadSquared stores all lead attributes (including name, email, phone) in a LeadPropertyList array as key-value pairs, not as direct object fields. Accessing lead.FirstName directly returns undefined because the data is nested inside the property array.
Solution: In your transformer, iterate over the LeadPropertyList array to build a flat attributes object before accessing field values: const attrs = {}; (lead.LeadPropertyList || []).forEach(prop => { attrs[prop.Attribute] = prop.Value; }); Then access attrs.FirstName, attrs.EmailAddress, etc. Preview the raw API response in Retool's Results panel to see the exact Attribute names used in your LeadSquared account's field configuration.
1const attrs = {};2(lead.LeadPropertyList || []).forEach(prop => {3 if (prop.Attribute && prop.Value !== undefined) {4 attrs[prop.Attribute] = prop.Value;5 }6});7// Now access fields:8const name = `${attrs.FirstName || ''} ${attrs.LastName || ''}`.trim() || attrs.EmailAddress || 'Unknown';Pagination shows incorrect total count or skips leads when paging through results
Cause: LeadSquared's pagination uses a zero-indexed pageIndex parameter. If the Retool Pagination component is 1-indexed, the first page request sends pageIndex=1 instead of 0, causing the first page of leads to be skipped.
Solution: In the URL parameter for pageIndex, subtract 1 from the Pagination component's current page value: pageIndex: {{ pagination.page - 1 || 0 }}. This converts Retool's 1-indexed pagination to LeadSquared's 0-indexed format. Also check the API response for a 'RecordCount' field and bind the Pagination component's total items to this value for accurate page count display.
Activity logging POST returns 200 but the activity does not appear in LeadSquared
Cause: LeadSquared's activity creation endpoint requires specific numeric ActivityEvent codes, not plain text activity type names. Sending an incorrect or invalid event code results in the API returning success without actually creating the activity record.
Solution: Query GET /v2/LeadManagement.svc/ActivityTypes.GetAll to retrieve all valid activity types and their numeric event codes. Use these exact codes in your activity creation POST body rather than guessing the values. Common codes include 206 for phone calls and 212 for email sent, but these can vary by LeadSquared account configuration.
Best practices
- Store LeadSquared Access Key and Secret Key in Retool Configuration Variables as secrets rather than embedding them directly in Resource URL parameters, where they may be visible to workspace members who can view Resource settings
- Use the correct regional API host URL for your LeadSquared account — India-region and other regional accounts have different base URLs that will cause authentication failures if the wrong URL is used
- Query activity type codes dynamically from /v2/LeadManagement.svc/ActivityTypes.GetAll instead of hardcoding numeric event codes in activity logging queries, since codes can vary by account configuration
- Extract lead attribute values using the LeadPropertyList iteration pattern in transformers — never access lead attributes as direct object fields since LeadSquared's API uses a key-value property array structure
- Enable query caching (30-60 seconds) for lead list queries used by multiple sales reps simultaneously to reduce API load and avoid hitting LeadSquared's rate limits in shared dashboard environments
- Build stage-change confirmation modals in Retool for irreversible lead state changes (like marking a lead as lost or converting to customer) to prevent accidental stage progressions that affect pipeline analytics
- Use Retool Workflows for automated lead assignment — create a Workflow triggered by a webhook from LeadSquared (when new leads are captured) that applies your round-robin assignment logic and posts the owner assignment back to LeadSquared via the API
Alternatives
HubSpot has a native Retool connector and broader international adoption, making it a better choice for teams that need pre-built integration support and a larger ecosystem of marketing tools.
Salesforce is the better choice for enterprise organizations needing deep customization, complex workflows, and global CRM capabilities beyond LeadSquared's emerging market focus.
Zoho CRM serves a similar SMB and emerging market audience with a more mature REST API and broader native integrations than LeadSquared, while sharing a similar pricing tier.
Frequently asked questions
Does Retool have a native LeadSquared connector?
No, Retool does not have a native LeadSquared connector. You connect via a REST API Resource with your LeadSquared Access Key and Secret Key as default URL query parameters. Unlike typical REST APIs that use Authorization headers, LeadSquared requires these credentials appended as query parameters on every API call.
Why does LeadSquared use query parameters for authentication instead of headers?
LeadSquared's API uses query parameter authentication (accessKey and secretKey appended to the URL) as its authentication mechanism. This is less common than header-based auth but works identically from a security perspective when used with HTTPS, since the query parameters are encrypted in transit. In Retool, configure these as default URL Parameters in the Resource settings rather than as Headers.
How do I filter leads by custom fields in LeadSquared from Retool?
Use the LeadSquared SearchLeads endpoint: POST /v2/LeadManagement.svc/Leads.GetByField with a JSON body specifying the field attribute name and search value. Custom field attribute names can be found in LeadSquared's Settings → Leads → Fields section. In Retool, bind the search attribute and value to UI component values to build a dynamic custom field search form.
Can I create new leads in LeadSquared from a Retool form?
Yes. Use POST /v2/LeadManagement.svc/Lead.Create with a JSON body containing a LeadPropertyList array of attribute-value pairs for the new lead's fields. Required fields typically include EmailAddress and at least a name. Build a Retool Form with fields for the key lead attributes, transform the input values into the LeadPropertyList format in the query body, and submit via a POST request. On success, refresh the leads table to show the newly created record.
How do I handle LeadSquared's lead scoring in Retool dashboards?
LeadSquared's lead score is stored as a lead attribute (typically with the Attribute name 'LeadScore') in the LeadPropertyList array. Extract it in your transformer using the standard property list iteration. Note that scores update asynchronously after activity logging — add a brief cache duration to score-related queries (or a manual refresh button) rather than showing scores as real-time values, since there may be a delay between activity logging and score recalculation.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation