Everything you need to connect your business to LS MarketFlow — capture leads, sync daily metrics, and generate trend intelligence, all from your own tools.
The LS MarketFlow API lets your business push data into the platform and pull insights out — no login required for server-to-server calls. There are four core capabilities:
Submit leads from your website or CRM into your pipeline.
Send customer interaction text and get AI-analyzed insights back.
Pull your saved trend reports into dashboards or spreadsheets.
Push daily call and booking metrics automatically via webhook.
New here? Your API key is generated when your business account is created. If you don't have one yet, contact your account manager or request access.
Most endpoints identify your business using an API key. Include it in every request as either an HTTP header or a query parameter:
X-Business-API-Key: YOUR_API_KEYhttps://lsmarketflow.com/functions/trendReportsApi?api_key=YOUR_API_KEYFor embedded widgets where you don't want to expose the API key, use your public slug instead:
?biz=YOUR_BUSINESS_SLUGKeep your API key secret
Treat it like a password. Never commit it to public repos or expose it in client-side code that runs in a browser. Use the slug method for public embeds.
Submit a new lead directly from your website form, CRM, or automation tool. The lead is saved to your pipeline and you're notified by email automatically.
https://lsmarketflow.com/functions/captureLeadcurl -X POST https://lsmarketflow.com/functions/captureLead \
-H "X-Business-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact_name": "Jane Smith",
"email": "jane@acme.com",
"phone": "404-555-0199",
"business_name": "Acme Auto Repair",
"industry": "auto_repair",
"biggest_challenge": "Missing calls after hours",
"interested_services": ["missed-call-capture", "review-generation"]
}'{
"ok": true,
"lead_id": "6a872f6b4ddbd92fc26675f4"
}contact_name — customer's nameemail — customer's emailDrop this iframe onto any page to capture leads with a pre-built form:
<iframe
src="https://lsmarketflow.com/embed/lead-capture?biz=YOUR_BUSINESS_SLUG"
width="100%"
height="520"
frameborder="0"
style="border-radius:12px; border:1px solid #e2e8f0;">
</iframe>Send a batch of customer interaction text (call notes, reviews, messages) and receive a full AI-analyzed trend report: keywords, urgency, sentiment, top requests, recommended actions, and ready-to-use marketing copy.
https://lsmarketflow.com/functions/trendIntelligenceApicurl -X POST https://lsmarketflow.com/functions/trendIntelligenceApi \
-H "X-Business-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_text": "Customers calling about oil changes and brake repair. Several complaints about long wait times. A few asked about Saturday appointments.",
"week_label": "Week of Aug 18, 2026",
"business_offer": "AI-powered booking and missed-call capture for auto shops"
}'{
"success": true,
"report": {
"id": "...",
"week_label": "Week of Aug 18, 2026",
"keywords": ["oil change", "brake repair", "wait times", "Saturday appointments"],
"category": "service_question",
"urgency_score": 3,
"revenue_opportunity": true,
"sentiment": "mixed",
"top_requests": ["Saturday availability", "faster service"],
"top_problems": ["long wait times"],
"approved_insights": ["..."],
"recommended_actions": "[{ \"action\": \"...\", \"priority\": \"high\" }]",
"social_post": "...",
"executive_summary": "...",
"status": "complete"
}
}input_text * — raw customer interaction text to analyzeweek_label — a label for the report, e.g. "Week of Aug 18, 2026"business_offer — your offering, used to tailor the generated marketing copyThis endpoint runs a multi-step AI pipeline and may take 10–30 seconds to respond. Avoid calling it synchronously from a user-facing page load.
Retrieve your saved trend reports (most recent 50) to display in your own dashboard, export to a spreadsheet, or feed into another system.
https://lsmarketflow.com/functions/trendReportsApicurl -H "X-Business-API-Key: YOUR_API_KEY" \
https://lsmarketflow.com/functions/trendReportsApi{
"success": true,
"reports": [
{ "id": "...", "week_label": "Week of Aug 18, 2026", "status": "complete", ... },
{ "id": "...", "week_label": "Week of Aug 11, 2026", "status": "complete", ... }
]
}Push your daily call and booking metrics into the platform so your weekly reports and revenue-leak analysis stay current. This endpoint uses a separate webhook secret (not your API key) — set it up under Insights → Data Sources.
https://lsmarketflow.com/functions/webhookIngestcurl -X POST https://lsmarketflow.com/functions/webhookIngest \
-H "Content-Type: application/json" \
-d '{
"secret": "YOUR_WEBHOOK_SECRET",
"metric_date": "2026-08-20",
"total_calls": 42,
"missed_calls": 7,
"after_hours_calls": 11,
"appointment_requests": 15,
"booked_appointments": 12,
"new_customers": 5,
"repeat_customers": 8
}'secret * — your webhook secret from Data Sourcesmetric_date * — the date for these metrics (YYYY-MM-DD)total_calls, missed_calls, after_hours_calls — call volume metricsappointment_requests, booked_appointments — booking metricsnew_customers, repeat_customers — customer metrics| Status | Meaning |
|---|---|
| 200 | Success — request completed normally |
| 400 | Bad Request — missing or invalid required field |
| 401 | Unauthorized — missing, invalid, or inactive API key / webhook secret |
| 403 | Forbidden — authenticated but not allowed to perform this action |
| 405 | Method Not Allowed — wrong HTTP verb (e.g. GET on a POST endpoint) |
| 500 | Server Error — something went wrong on our side; retry shortly |
Never hardcode your API key in source files. Load it from an environment variable or secret manager.
For website widgets visible to visitors, use ?biz=YOUR_SLUG instead of the API key to keep it private.
Trend analysis takes 10–30 seconds. Call it from a background job or cron, not a live page request.
Transient server errors happen. Retry failed requests after a short delay, with exponential backoff.
Push your daily metrics once per day (e.g. overnight) so weekly reports have complete data.
Grab your API key from your business settings and start with the Lead Capture endpoint — it's the fastest way to test your connection.
Talk to our team