Skip to main content
RapidDev - Software Development Agency
flutterflow-integrationsFlutterFlow API Call

LeadSquared

Connect FlutterFlow to LeadSquared by routing all API calls through a Firebase Cloud Function — the Access Key and Secret Key are passed as query parameters, which means they would be visible in the URL if called directly from the client. The Cloud Function appends the keys server-side and forwards requests to the region-specific LeadSquared host. The core use case is pushing new signups from a FlutterFlow form into the LeadSquared CRM pipeline via the Lead.Capture endpoint.

What you'll learn

  • Why LeadSquared's query-parameter authentication is a client-side security risk and how to fix it with a Cloud Function proxy
  • How to confirm your account's region-specific host (api.leadsquared.com vs api.in21.leadsquared.com) before building
  • How to build a FlutterFlow lead capture form and wire it to the Lead.Capture API endpoint
  • How to store the returned LeadSquared lead ID in Firestore or App State for future activity attribution
  • How to dynamically fetch activity type codes with GetActivityTypes.GetAll instead of hardcoding numeric values
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate20 min read60 minutesCRM & SalesLast updated July 2026RapidDev Engineering Team
TL;DR

Connect FlutterFlow to LeadSquared by routing all API calls through a Firebase Cloud Function — the Access Key and Secret Key are passed as query parameters, which means they would be visible in the URL if called directly from the client. The Cloud Function appends the keys server-side and forwards requests to the region-specific LeadSquared host. The core use case is pushing new signups from a FlutterFlow form into the LeadSquared CRM pipeline via the Lead.Capture endpoint.

Quick facts about this guide
FactValue
ToolLeadSquared
CategoryCRM & Sales
MethodFlutterFlow API Call
DifficultyIntermediate
Time required60 minutes
Last updatedJuly 2026

Capturing Leads from FlutterFlow into LeadSquared CRM

LeadSquared is a CRM and marketing automation platform popular with sales-heavy businesses — edtech companies, financial services firms, and healthcare providers commonly use it to manage inbound leads across web, mobile, and phone channels. If you are building a FlutterFlow app with a signup form, trial request screen, or contact page, connecting it to LeadSquared means every submission flows directly into the sales pipeline with the correct lead source and field mapping your sales team expects.

Although LeadSquared appears in the Payments category in the integration manifest, it is actually a CRM and lead management tool — there are no payment transactions involved. The integration is about pushing new app signups into LeadSquared and optionally logging in-app activities (such as 'User completed onboarding' or 'User viewed pricing page') to enrich lead profiles over time.

The key technical wrinkle is LeadSquared's authentication method: instead of a standard Authorization header, it passes the Access Key and Secret Key as URL query parameters appended to every request URL. In a FlutterFlow app that compiles to Flutter code running on the user's device, these query parameters would be visible in the compiled bundle and in network traffic logs. A Firebase Cloud Function proxy is the correct approach — the function receives lead data from FlutterFlow, appends the keys server-side, and forwards the request to the correct region-specific LeadSquared host. API rate limits and pricing are not publicly disclosed; check your plan's quotas directly with your LeadSquared account manager.

Integration method

FlutterFlow API Call

FlutterFlow sends form data to a Firebase Cloud Function, which appends the LeadSquared Access Key and Secret Key as query parameters and forwards the request to the region-specific LeadSquared REST API host. The API Call in FlutterFlow points to the Cloud Function URL, never to LeadSquared directly, ensuring the keys never appear in the compiled Flutter app bundle or in network logs on the client side.

Prerequisites

  • A LeadSquared account (paid plan) with API access enabled — confirm your region-specific API host from Settings → API and Webhooks
  • Your LeadSquared Access Key and Secret Key from Settings → API and Webhooks in the LeadSquared dashboard
  • A Firebase project on the Blaze (pay-as-you-go) plan with Cloud Functions enabled
  • FlutterFlow project connected to Firebase (Settings & Integrations → Firebase in FlutterFlow)
  • Familiarity with the LeadSquared field schema — know which standard fields (FirstName, LastName, EmailAddress, Phone, Source) map to your app's form fields

Step-by-step guide

1

Confirm your region host and collect API credentials

LeadSquared assigns each account to a regional data center, and the API host varies by region. The default host is https://api.leadsquared.com, but Indian accounts typically use https://api.in21.leadsquared.com, and other regions may use different subdomains. Using the wrong host is the most common cause of authentication errors — you get a generic host/auth failure rather than a clear 'wrong host' message. To find your correct host: log into your LeadSquared dashboard and go to Settings (gear icon) → API and Webhooks. The page will display your Access Key, Secret Key, and the API host for your account. Copy all three values. The Access Key is a long alphanumeric string (similar to a username) and the Secret Key is a longer hex string (similar to a password). Both are required on every API call. Do not store these credentials anywhere in your FlutterFlow project — not in App Values, not in App State, not hardcoded in Custom Actions. They will go into a Firebase Cloud Function environment variable in the next step, where they remain server-side and out of the compiled app bundle. If you accidentally commit them to a GitHub repo or expose them in a FlutterFlow API Call, rotate them immediately from Settings → API and Webhooks → Regenerate. Also note your LeadSquared account's time zone and date format, as some activity logging endpoints require dates in a specific format (ISO 8601 or YYYY-MM-DD HH:mm:ss). Getting this wrong doesn't break lead capture but causes activity timestamps to appear incorrect in the CRM.

Pro tip: If you are unsure which region host to use, paste your Access Key and Secret Key into the LeadSquared API Playground (available at https://apidocs.leadsquared.com) and try a simple GET call like /v2/LeadManagement.svc/Lead.GetAll with a small pageSize. If it returns data, the host is correct. If it returns a 401 or host error, try the other regional host.

Expected result: You have your LeadSquared Access Key, Secret Key, and confirmed region API host URL (e.g. https://api.in21.leadsquared.com) ready to add to the Cloud Function in the next step.

2

Deploy a Cloud Function to proxy Lead.Capture

Create a Firebase HTTPS Cloud Function that acts as a secure proxy between FlutterFlow and LeadSquared. The function receives lead field data (name, email, phone, source, and any custom fields) from FlutterFlow as a JSON POST body, then constructs the URL to the LeadSquared Lead.Capture endpoint with the Access Key and Secret Key appended as query parameters, and forwards the lead data as the POST body. Store the LeadSquared credentials as Firebase Cloud Function secrets using the Firebase Functions config system or Secret Manager. In the function code, build the full LeadSquared URL by appending ?accessKey=VALUE&secretKey=VALUE to the endpoint path. Never hardcode the key values in the function source code — always read them from environment secrets so that your source code repository does not contain credentials. The Lead.Capture endpoint (POST /v2/LeadManagement.svc/Lead.Capture) accepts an array of lead field objects, each with Attribute (field name) and Value. Map the form fields from your FlutterFlow form to LeadSquared's standard attributes: FirstName, LastName, EmailAddress, Phone, Source, LeadQuality, and any custom fields your account uses. The response from LeadSquared includes a Status ('Success' or error) and the LeadId of the created or updated lead (Lead.Capture upserts on matching email or phone — if a lead with the same email already exists, it updates that record rather than creating a duplicate). Return the lead ID from the Cloud Function back to FlutterFlow so you can store it for subsequent activity logging. Deploy the function and test it by calling it directly with a curl command or Postman before wiring it to FlutterFlow.

index.js
1// Firebase Cloud Functions v2 — LeadSquared Lead.Capture proxy (index.js)
2const { onRequest } = require('firebase-functions/v2/https');
3const { defineSecret } = require('firebase-functions/params');
4const cors = require('cors')({ origin: true });
5const fetch = require('node-fetch');
6
7const LS_ACCESS_KEY = defineSecret('LEADSQUARED_ACCESS_KEY');
8const LS_SECRET_KEY = defineSecret('LEADSQUARED_SECRET_KEY');
9// Set your region host here — update to api.in21.leadsquared.com for India accounts
10const LS_HOST = 'https://api.leadsquared.com';
11
12exports.captureLeadSquaredLead = onRequest(
13 { secrets: [LS_ACCESS_KEY, LS_SECRET_KEY] },
14 async (req, res) => {
15 cors(req, res, async () => {
16 if (req.method !== 'POST') {
17 return res.status(405).json({ error: 'Method not allowed' });
18 }
19 const { firstName, lastName, email, phone, source, customFields } = req.body;
20
21 // Build the lead attributes array expected by LeadSquared
22 const leadAttributes = [
23 { Attribute: 'FirstName', Value: firstName || '' },
24 { Attribute: 'LastName', Value: lastName || '' },
25 { Attribute: 'EmailAddress', Value: email || '' },
26 { Attribute: 'Phone', Value: phone || '' },
27 { Attribute: 'Source', Value: source || 'Mobile App' },
28 ];
29
30 // Merge any custom fields passed from FlutterFlow
31 if (customFields && Array.isArray(customFields)) {
32 leadAttributes.push(...customFields);
33 }
34
35 const url =
36 `${LS_HOST}/v2/LeadManagement.svc/Lead.Capture` +
37 `?accessKey=${LS_ACCESS_KEY.value()}&secretKey=${LS_SECRET_KEY.value()}`;
38
39 try {
40 const response = await fetch(url, {
41 method: 'POST',
42 headers: { 'Content-Type': 'application/json' },
43 body: JSON.stringify(leadAttributes),
44 });
45 const data = await response.json();
46 if (!response.ok || data.Status !== 'Success') {
47 return res.status(400).json({ error: data });
48 }
49 return res.json({ leadId: data.LeadId, status: data.Status });
50 } catch (err) {
51 return res.status(500).json({ error: err.message });
52 }
53 });
54 }
55);

Pro tip: Lead.Capture upserts on matching email address and phone number — if a lead with the same email already exists, it updates that record instead of creating a new one. This is usually the desired behavior (avoiding duplicates), but be aware it can silently update an existing lead's fields if your users share email addresses or enter someone else's contact info.

Expected result: The Cloud Function is deployed and returns { leadId: '...', status: 'Success' } when called with a POST containing firstName, lastName, email, phone, and source fields. You can verify this with Postman before wiring it to FlutterFlow.

3

Build the lead capture form in FlutterFlow

In FlutterFlow, design the lead capture form on your target page. Use Text Field widgets for name, email, phone, and any other required fields. Set each Text Field to be bound to a Page State variable: create Page State variables (under State Management in the left panel) for each field — firstName (String), lastName (String), emailAddress (String), phone (String), and any custom fields you need. For validation: add a Form widget as a wrapper (from the widget library) and mark EmailAddress as 'Email' type (triggers basic email format validation) and Phone as 'Phone' type. Add a Validate Form action to the submit button's Action Flow so users see inline errors before the API call fires. Wire the submit button to an Action Flow with these steps: (1) Validate Form — if invalid, stop. (2) Show Loading Indicator (set a Boolean Page State variable isSubmitting to true and show a CircularProgressIndicator overlay). (3) Call the API Action for the Cloud Function (configured in the next step). (4) On success, store the returned leadId in a persistent App State variable or write it to Firestore alongside the user's profile. (5) Navigate to a thank-you page or show a SnackBar. (6) Always turn off the loading indicator in both success and error branches. Also consider adding a hidden 'Source' field that automatically captures where in the app the lead came from (e.g. 'Homepage CTA', 'Pricing Screen', 'Feature Tour') — this is extremely valuable for LeadSquared analytics and lead scoring, and costs nothing extra to send. You can hardcode the source value per page rather than making it a user-visible field.

Pro tip: LeadSquared's standard Source field accepts free text, but your sales team will have defined a set of acceptable source values in LeadSquared's settings for pipeline filtering. Ask for the exact source strings before deployment so the leads route to the correct pipeline stage automatically.

Expected result: The FlutterFlow form page shows text fields for name, email, phone, and source. Page State variables are bound to each field. The submit button has a multi-step Action Flow that validates the form and (once the API Call is configured in the next step) will send the data to the Cloud Function.

4

Configure the FlutterFlow API Call to the Cloud Function

In FlutterFlow, click API Calls in the left navigation sidebar, then click + Add → Create API Group. Name it 'LeadSquaredProxy' and set the base URL to your Firebase Cloud Function's base HTTPS URL (e.g. https://us-central1-yourproject.cloudfunctions.net). This points to your Cloud Function, NOT to LeadSquared's API directly — the Cloud Function handles the key appending and forwarding. Inside the API Group, click + Add API Call. Name it 'CaptureLead'. Set the method to POST and the endpoint to /captureLeadSquaredLead (matching your function name exactly). In the Body tab, select JSON format and add the fields your form collects: { "firstName": "{{ firstName }}", "lastName": "{{ lastName }}", "email": "{{ emailAddress }}", "phone": "{{ phone }}", "source": "{{ source }}" }. In the Variables tab, add variables for each field (all String type). Set the Content-Type header to application/json. You do NOT need any Authorization header or API keys in FlutterFlow — all credentials live in the Cloud Function. Click Test in the Response & Test tab. Enter sample values and fire the call. Paste the sample success response and click Generate JSON Paths. Map $.leadId as a JSON Path extraction so you can store the lead ID after a successful call. Now go back to your form page and update the submit button's Action Flow: after validation, add a Backend/API Call action pointing to the CaptureLead API Call, passing the Page State variables as the API Call variables. Add a conditional after it: if $.leadId is not empty → store the leadId in App State and navigate to success screen. If the call returned an error → show a SnackBar with an error message.

typescript
1// FlutterFlow API Call config reference
2// API Group: LeadSquaredProxy
3// Base URL: https://us-central1-yourproject.cloudfunctions.net
4// (Replace with your actual Cloud Function project and region)
5//
6// API Call: CaptureLead
7// Method: POST
8// Endpoint: /captureLeadSquaredLead
9// Headers: Content-Type: application/json
10// (No Authorization header needed — keys are in the Cloud Function)
11//
12// Body (JSON):
13// {
14// "firstName": "{{ firstName }}",
15// "lastName": "{{ lastName }}",
16// "email": "{{ emailAddress }}",
17// "phone": "{{ phone }}",
18// "source": "{{ source }}"
19// }
20//
21// Response JSON Paths:
22// $.leadId → leadId (String)
23// $.status → leadStatus (String)

Pro tip: If your LeadSquared account uses custom lead fields (e.g. LoanAmount, CourseInterest, PropertyBudget), pass them as an array in a customFields variable and merge them in the Cloud Function. This is cleaner than adding individual variables for each custom field in FlutterFlow.

Expected result: The CaptureLead API Call in FlutterFlow returns { leadId: '...', status: 'Success' } in the Response & Test panel. The leadId JSON Path extraction is mapped. The form submit button Action Flow is fully wired to call the API and store the leadId.

5

Store the lead ID and optionally log in-app activities

After a successful lead capture, the Cloud Function returns the LeadSquared leadId (a unique identifier for the lead record). Store this in FlutterFlow's App State (for the current session) and optionally in Firestore alongside the user's UID if your app has authentication. This ID is what you use to log future activities against the lead — without it, activity calls will create orphaned records or fail. Activity logging is the second high-value use of the LeadSquared API. If your app has meaningful user actions (completed a quiz, viewed a pricing screen, started a free trial, booked a demo), logging these as LeadSquared activities gives the sales team a timeline of engagement in their CRM. The endpoint is POST /v2/LeadManagement.svc/Activity.Create and it requires the leadId, an activityCode (a numeric ID for the activity type defined in LeadSquared), a note, and a timestamp. Activity type codes are account-specific and not globally standardized — a code that means 'Viewed Pricing' in one account might mean something else in another. Never hardcode these numeric codes. Instead, deploy a second Cloud Function (or add a route to the existing function) that calls GET /v2/LeadManagement.svc/Lead.GetActivityTypes.GetAll to fetch all activity types and their codes, then cache the response in Firestore or App State. Refresh this cache periodically or on app startup. For a simpler first implementation: build the activity logging as a second API Call in FlutterFlow pointing to a /logLeadActivity endpoint on your Cloud Function. Pass the leadId from App State, the activity code (fetched dynamically), a note, and the current timestamp. Call this from key page Action Flows: on navigating to the pricing page, on completing an onboarding step, on booking a consultation. This transforms your app from a simple lead capture form into a full sales intelligence tool.

index.js
1// Firebase Cloud Function — activity logging route (add to index.js)
2const LS_ACCESS_KEY = defineSecret('LEADSQUARED_ACCESS_KEY');
3const LS_SECRET_KEY = defineSecret('LEADSQUARED_SECRET_KEY');
4const LS_HOST = 'https://api.leadsquared.com'; // update per region
5
6exports.logLeadActivity = onRequest(
7 { secrets: [LS_ACCESS_KEY, LS_SECRET_KEY] },
8 async (req, res) => {
9 cors(req, res, async () => {
10 if (req.method !== 'POST') return res.status(405).send('Method not allowed');
11 const { leadId, activityCode, note } = req.body;
12 if (!leadId || !activityCode) {
13 return res.status(400).json({ error: 'leadId and activityCode are required' });
14 }
15 const now = new Date().toISOString().replace('T', ' ').substring(0, 19);
16 const payload = [
17 {
18 LeadId: leadId,
19 ActivityEvent: activityCode,
20 ActivityNote: note || '',
21 ActivityDateTime: now,
22 },
23 ];
24 const url =
25 `${LS_HOST}/v2/LeadManagement.svc/Activity.Create` +
26 `?accessKey=${LS_ACCESS_KEY.value()}&secretKey=${LS_SECRET_KEY.value()}`;
27 try {
28 const response = await fetch(url, {
29 method: 'POST',
30 headers: { 'Content-Type': 'application/json' },
31 body: JSON.stringify(payload),
32 });
33 const data = await response.json();
34 return res.json(data);
35 } catch (err) {
36 return res.status(500).json({ error: err.message });
37 }
38 });
39 }
40);

Pro tip: If you need RapidDev's help setting up the full LeadSquared integration — including activity type fetching, dynamic field mapping, and pipeline-routing logic — the team handles FlutterFlow CRM integrations every week. Book a free scoping call at rapidevelopers.com/contact.

Expected result: The lead ID is stored in FlutterFlow App State after successful capture. A second API Call for activity logging is configured in FlutterFlow. Key in-app user actions (pricing view, quiz completion, etc.) trigger the activity logging call, enriching the lead's CRM record in real time.

Common use cases

Edtech onboarding app that captures trial signups as leads

A course discovery app built in FlutterFlow where users fill in their name, email, phone, and subject of interest. On form submission, the app calls a Cloud Function that posts the lead to LeadSquared with source='Mobile App' and any relevant UTM fields. The lead immediately appears in the sales team's LeadSquared pipeline for follow-up.

FlutterFlow Prompt

Build a multi-step onboarding form with name, email, phone, and 'which course interests you?' fields. On the final step, call the LeadSquared Cloud Function to create a lead with all the form data, store the returned lead ID in App State, and navigate to a 'We'll be in touch' confirmation screen.

Copy this prompt to try it in FlutterFlow

Real estate app that tracks in-app property views as lead activities

A property listing app where users browse properties and shortlist favorites. Each time a user views a property detail page, the app logs a 'Property Viewed' activity against their LeadSquared lead record using the Activity.Create endpoint. Sales agents can then see exactly which properties each lead has engaged with before making contact.

FlutterFlow Prompt

On the property detail page, after the page loads, call the LeadSquared activity logging Cloud Function with the lead ID (stored in App State from initial signup), the activity type code for 'Property Viewed', and the property name and ID as activity notes.

Copy this prompt to try it in FlutterFlow

Financial services app that flags high-intent users for outreach

A loan calculator or investment app where users who reach a 'Calculate my eligibility' screen are considered high-intent. The app creates a LeadSquared lead with score-boosting fields (loan amount, income bracket, urgency) and marks them as 'Hot' via the lead quality field. The sales team sees these leads rise to the top of their queue immediately.

FlutterFlow Prompt

When a user submits the eligibility calculator, capture their loan amount, income range, and contact details. Send these to LeadSquared via the Cloud Function with LeadQuality set to 'Hot' and Source set to 'Eligibility Calculator'. Show the user a 'One of our advisors will call you shortly' screen.

Copy this prompt to try it in FlutterFlow

Troubleshooting

401 Unauthorized or host/auth error when calling LeadSquared — even though credentials look correct

Cause: The most common cause is a region host mismatch. Your account may be on api.in21.leadsquared.com but the Cloud Function is sending requests to api.leadsquared.com (or vice versa). Each regional host requires its own credentials — keys from one region will not authenticate against a different region's host.

Solution: Log into the LeadSquared dashboard → Settings → API and Webhooks and copy the exact host URL shown on that page. Update the LS_HOST constant in your Cloud Function to this exact URL and redeploy. Do not guess the host based on your account's country — always read it from the dashboard.

typescript
1// In Cloud Function — update to your exact region host
2const LS_HOST = 'https://api.in21.leadsquared.com'; // example for India accounts

Lead.Capture returns Status: 'Error' with message about duplicate leads or missing required fields

Cause: LeadSquared requires at least one of EmailAddress or Phone to create a lead (both fields identified as unique identifiers). If both are empty, the call fails. If a required field is misspelled as an Attribute name (e.g. 'Email' instead of 'EmailAddress'), the lead is created with missing data and may hit deduplication issues.

Solution: Validate that at least one of EmailAddress or Phone is non-empty before calling the Cloud Function. Verify all Attribute names exactly match LeadSquared's field schema: 'FirstName', 'LastName', 'EmailAddress', 'Phone', 'Source'. Custom field attribute names must match exactly as defined in your LeadSquared account schema (check under Settings → Field Definitions).

typescript
1// In Cloud Function — validate required fields before calling LeadSquared
2if (!email && !phone) {
3 return res.status(400).json({ error: 'At least one of email or phone is required' });
4}

XMLHttpRequest error when calling the Cloud Function from FlutterFlow web preview

Cause: CORS (Cross-Origin Resource Sharing) is blocking the browser request. The Cloud Function is not returning CORS headers that allow the FlutterFlow web preview or your deployed web app's origin to make cross-origin POST requests.

Solution: Add the cors npm package to your Cloud Function and wrap the handler with cors({ origin: true }). This is needed for web builds only — native iOS and Android Flutter builds do not enforce CORS. After redeploying the function, the FlutterFlow web preview and web builds will be able to call it without browser CORS errors.

typescript
1const cors = require('cors')({ origin: true });
2exports.captureLeadSquaredLead = onRequest({ secrets: [...] }, (req, res) => {
3 cors(req, res, async () => { /* handler */ });
4});

Activity logging fails with 'Invalid ActivityEvent' or activity codes return 0 results

Cause: Activity type codes in LeadSquared are account-specific numeric IDs. Hardcoding an activity code that works in your account's sandbox or a different account will break in production. The code 0 or undefined typically means an invalid or missing activity type code was passed.

Solution: Call GET /v2/LeadManagement.svc/Lead.GetActivityTypes.GetAll via your Cloud Function to retrieve all activity types and their codes for your specific account. Cache the results in Firestore or App State at app startup. Use the fetched codes when logging activities — never hardcode numeric activity codes in your FlutterFlow project.

Best practices

  • Never put the LeadSquared Access Key or Secret Key anywhere in FlutterFlow — not in API Call headers, not in App Values, not in Custom Actions — because they appear as query parameters in URLs and are trivially visible in compiled app bundles and network logs
  • Always confirm the region-specific API host from LeadSquared Settings → API and Webhooks before writing any code — using the wrong host is the most common auth failure and produces confusing error messages
  • Capture a Source field on every lead that identifies which app screen or feature triggered the capture (e.g. 'Pricing Screen', 'Feature Tour CTA') — this data is invaluable for LeadSquared pipeline analytics and lead scoring with zero extra cost
  • Store the leadId returned by Lead.Capture in Firestore (linked to the user's UID) rather than only in App State — App State is session-scoped and is lost when the user closes the app, making activity logging impossible on the next session without a Firestore lookup
  • Fetch activity type codes dynamically with GetActivityTypes.GetAll at app startup and cache them — hardcoding numeric activity codes breaks silently when your LeadSquared admin renames or reconfigures activity types
  • Handle Lead.Capture's upsert behavior intentionally — since the endpoint updates existing leads on email/phone match rather than creating duplicates, design your form to capture the most complete data on first submission rather than relying on a subsequent update
  • Validate that at least one of EmailAddress or Phone is populated before calling Lead.Capture — LeadSquared requires at least one identifier, and a form submission with both empty will fail and lose the lead data
  • Test the Cloud Function directly with Postman or curl before wiring it to FlutterFlow — confirm the correct host, field names, and response format independently so you are debugging one layer at a time

Alternatives

Frequently asked questions

Can I call the LeadSquared API directly from FlutterFlow without a Cloud Function?

Technically yes, but you should not. LeadSquared's authentication uses Access Key and Secret Key as URL query parameters, which means they appear in the full URL of every API Call. In a compiled Flutter app, API Call configurations are embedded in the binary and can be extracted by decompiling the APK or IPA. Even setting that aside, query-parameter credentials are visible in mobile network traffic logs and on corporate proxies. A Firebase Cloud Function or Supabase Edge Function proxy keeps the credentials server-side where they belong.

My LeadSquared account is on the India region. Do I need to do anything differently?

Yes — you must use https://api.in21.leadsquared.com as your host URL in the Cloud Function, not the default https://api.leadsquared.com. The authentication credentials are region-specific, meaning keys issued for the India region will only work against the India region host. Confirm your exact host from LeadSquared Settings → API and Webhooks and update the LS_HOST constant in your Cloud Function before deploying.

Will Lead.Capture create duplicate leads if the same user submits the form twice?

No — Lead.Capture is an upsert operation that deduplicates on EmailAddress and Phone. If a lead with the same email address already exists, the call updates that lead record with the new field values rather than creating a second record. If neither email nor phone matches an existing lead, a new lead is created. This behavior is generally desirable (avoids duplicates) but means you should send the most complete data on the first call, since subsequent calls with the same email might overwrite fields the sales team has manually updated.

Can I use Supabase Edge Functions instead of Firebase Cloud Functions for the proxy?

Yes. The proxy logic works identically in a Supabase Edge Function (Deno runtime). Replace the Firebase Functions v2 imports with standard Deno fetch calls. Store the LeadSquared keys as Supabase secrets (accessible via Deno.env.get()). The FlutterFlow API Call points to your Supabase Edge Function URL instead of a Firebase Function URL. The LeadSquared API call itself is the same — only the hosting environment changes.

What is the LeadSquared API rate limit?

LeadSquared does not publish a public rate limit for its API. Limits are plan-dependent and may vary by endpoint. If your app generates high-volume lead submissions (e.g. from a viral campaign), contact your LeadSquared account manager to confirm the API quota for your plan. For typical mobile app lead capture (dozens to hundreds of submissions per day), rate limits are unlikely to be an issue.

Do I need special LeadSquared plan to access the API?

API access in LeadSquared requires a paid plan — there is no public free tier with API access. The API Keys section (Settings → API and Webhooks) is only available on paid subscriptions. Check with your LeadSquared account representative which plan tier includes REST API access, as feature availability varies by plan. If the API Keys section is missing from your settings, your current plan may not include API access.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire FlutterFlow integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.