Run a Local Flywheel sub-account from your own software or an AI assistant: leads, deal value and won jobs, pipeline stages, bookings and calendars, texts and emails, the inbox, calls, forms, automations and settings. 605 endpoints, one MCP server.
Every path below starts with /v1 after the API address, and every answer has the same shape: { "success": true, "data": { ... }, "error": null }, or success: false with an error message and a matching HTTP status.
A key works inside its own sub-account only. Leave out workspace_id wherever you see it: the key fills it in, a different one is ignored, and records of any other sub-account answer 404.
An admin of the sub-account creates keys in Local Flywheel under Settings → API. Each key is shown once; revoke it there the moment you stop using it. Send it with every request:
Header
Authorization: Bearer zu-...
Access level
What the key can do
Read only
Look things up. Nothing is created, changed or sent.
Read and write
Create and update leads, bookings and settings, send messages and enroll leads in automations. Cannot delete things or manage the team.
Full access
Everything, including deleting, team members, and sending lead data to other tools (webhooks, alert recipients).
Each endpoint below shows the level it needs. Calls also follow the role of the person who made the key: a key keeps working only while they are an admin of the sub-account.
Quick start
Pick your language once; every example on the page follows it.
Mark a job won and record what it was worth
Set the lead's status and deal value (in cents). Moving it to a pipeline stage works the same with stage_key.
Pick a calendar (GET /v1/calendars), find an open time (GET /v1/calendars/{calendar_id}/availability), then book it. The customer gets the usual confirmation and reminders unless you send notify_lead: false.
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/leads",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"full_name": "Jane Smith",
"phone": "+15125550123",
"email": "jane@example.com",
"inquiry": "Roof leak over the garage",
},
)
print(res.json())
Text a customer
Sent from the sub-account's number, exactly like a text from the inbox. Add send_at to schedule it.
cURL
curl -X POST "https://api.localflywheel.com/v1/messages" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"lead_id": "LEAD_ID",
"channel": "sms",
"body": "Hi Jane, we can come out Tuesday at 10."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
lead_id: "LEAD_ID",
channel: "sms",
body: "Hi Jane, we can come out Tuesday at 10.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/messages",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"lead_id": "LEAD_ID",
"channel": "sms",
"body": "Hi Jane, we can come out Tuesday at 10.",
},
)
print(res.json())
AI assistants (MCP)
Claude, ChatGPT, Cursor and other assistants can run the sub-account through the MCP server at https://api.localflywheel.com/mcp (Streamable HTTP, JSON-RPC 2.0). Use the same API key; the assistant can do exactly what the key allows, so a Read only key is a safe way to start.
Claude (web, desktop, mobile): custom connector
Settings → Connectors → Add custom connector. Name it, paste this URL, leave OAuth blank. Treat the URL like a password.
get_api_key_info — Access level, sub-account lock, rate limit, credit budget and 30-day usage of the connected key.
Sub-account setup
get_setup_checklist — Start here: what is configured, what is missing, and the tool that fixes each finding.
manage_offers — Offers: first text, follow-ups, AI notes, triggers. list / create / update / delete.
manage_calendars — Booking calendars, their hosts and their booking page: prices with options and add-ons, deposit, design, full days, shared schedule, booking questions, booking requests (confirmed before they are set). create / update / copy_design / generate_design.
manage_booking_menus — Service menus: one booking link listing several calendars in sections. list / create / update / delete / share_schedule / generate_design.
manage_calendar_routes — Calendar routing: which calendar each lead books on, from their answers or tags. list / create / update / delete / reorder / match.
business_hours — Time zone, weekly hours, days off, slot length. get / set.
manage_pipeline_stages — Add, rename, hide, reorder or delete pipeline stages.
manage_custom_fields — Custom lead fields. list / create / update / archive.
lead_routing — How new leads are handed out: round robin (even turns or by percentage) or Grab it (first to tap the alert gets the lead). get / set.
manage_alert_recipients — Who is texted or emailed about new leads and AI receptionist calls, and which leads each one hears about (admin scope to change).
manage_lead_sources — Private URLs that accept leads from any form or tool.
manage_outbound_webhooks — Push lead, appointment, message and AI receptionist call events to Zapier, Make or a CRM (admin scope).
knowledge_base — The FAQ the AI answers from. get / add / replace.
ai_receptionist — The AI that answers the phone. get / configure.
manage_smart_forms — Create a smart form, change its basics, questions (photos, prices on answers), instant estimate, hidden fields, service area and calendar routing, publish it.
configure_workspace_outreach — Auto-greet, AI replies, follow-ups, reminders, sending identity.
ai_texting — The AI texting agent and automatic texts: replies on/off, name, reply mode, first text, send window, reminders, missed-call text, prompt rules. get / set.
nurture_sequence — The automatic follow-up texts and emails. get / set / edit / enable / disable / clear.
business_profile — Name, industry, time zone, address, country, business phone and email. get / set.
list_phone_numbers — The sub-account's numbers and whether texting is ready.
manage_pipelines — Extra pipelines (More pipelines): list, create, rename, delete, and add, change or delete their stages.
texting_status — Read only: where the business's texting registration with the phone carriers stands, whose move it is and what's needed, whether a number can text now, and numbers on order outside the US. Filing and buying stay in the app.
Dashboard & inbox
get_overview — Dashboard numbers: leads, booked, speed to lead, AI replies, calls, and how many leads reached each pipeline stage.
get_usage — Credits used by tool and by day.
list_conversations — The Inbox: conversations with unread counts, last message and AI state.
update_conversation — Mark read / unread, archive / unarchive.
pause_lead_ai — Pause or resume the AI on one lead.
list_reply_suggestions — AI suggested replies waiting for approval.
decide_reply_suggestion — Approve (sends, charged like an AI reply) or dismiss a suggested reply.
reply_ideas — The Inbox's reply assistant: three replies in the business's tone, or a draft polished. Sends nothing.
needs_reply — Needs you now: who is waiting on a person and why (a question the AI handed over, a missed call, an unanswered message).
list_calls — Phone calls with outcome and AI summary.
get_call — One call: summary, transcript, 15-minute recording link.
call_campaigns — AI calling campaigns: list with progress, or pause one.
busy_blocks — Team members' busy time from other software: list, set (add or replace by your id), remove, sync a window.
ai_lessons — The AI Brain: list lessons, add rules, switch off, reword or delete.
rate_ai_message — Thumbs up / down on an AI message to teach the AI.
invoices — Invoices, read only (deposit and balance invoices say so). list / get.
stripe_payments — Payments from the business's own Stripe (Payment Links): the payments recorded and the lead each reached; turn tracking on or off and pick the stage and Meta event.
estimates — Estimates: list / get / the price book, and create (a draft with Good / Better / Best options, or from a quote template), update, send to the lead, convert to an invoice, delete. With Quote templates: template_id, add-on lines, on_approve, booking_calendar_id.
estimate_templates — Quote templates (needs Settings > Features > Quote templates): list / get the saved quotes estimates start from, and create, update or delete one (options and lines, add-ons, what approving does: a signature, an invoice to pay, Won).
get_ad_insights — The sub-account's Ad Insights: spend, leads and cost per lead across its Meta ad accounts, per campaign and ad.
google_ads — Its Google Ads: the connection and conversions sent back, and live reports (campaigns, keywords, search terms...).
google_business — Google Business Profiles: profiles, reviews and replies, posts, Profile Optimizer runs.
map_rankings — Map Rankings: keywords, scans, one scan's grid and next steps.
business_listings — Business Listings: each directory's status and what's needed.
manage_google_business — Change the Google Business Profile: create, AI-write, edit, approve, unschedule, publish and delete posts; draft, edit, skip and post review replies; apply or undo Profile Optimizer suggestions.
manage_map_rankings — Map Rankings: track a keyword, change its schedule (weekly, monthly, off) or grid, stop tracking it, scan one now (credits).
manage_listings — Business Listings: check the directories (free), start listing the business (credits).
support_tickets — Support tickets: list, read, open one, add to it; the support team replies, adds notes, sets status, priority, assignee.
health_score — The 0-100 health score: one sub-account's breakdown and what would raise it, or every sub-account's score and rank.
ai_brain_photos — AI Brain photos the AI may send: list, add from a link, change, remove.
ai_brain_prices — AI Brain prices the AI may quote: list, add one or many, change, remove, and what it says with prices.
ai_brain_waiting — Questions waiting on you: list, answer (trains the AI, resumes it), dismiss.
get_sales_report — The Sales page: won jobs, parts, tips and profit by technician, lead source and tag.
list_activity — The Activity log: every change and who made it, access, messages, calls, automations and errors.
reviews — Review pages, who rated what, and a lead's review link.
call_tracking — Call Tracking: calls from tracking numbers and where they came from (overview), the calls and one call in full (the visit, transcript, the AI's read), label a call or its value, the numbers with pool advice, add website or one-place numbers, remove one, settings and setup.
click_guard — Click Guard: the sub-account's protection score, invalid ad clicks and what they cost (overview), the clicks and one click in full, blocked addresses, block / unblock an IP, settings, sync with Google Ads, questions in plain words (ask), the install line, fake leads from the ads (leads, not_junk), Audience Network in the Meta ad sets (meta_cleanup) and the Google campaigns' search partners, Display Network and location setting (google_cleanup).
website_analytics — Website Analytics: the sub-account's own website visitors, sources and ads, pages, conversions, frustration and forms (overview), the code to install (install), and questions in plain words (ask). Several sites per sub-account, each with its own code and numbers: sites lists them, add_site adds one, site_id picks one.
reports — Reports: build one from plain words or a ready-made one, change it, read its numbers, email it now or every week or month (numbers in the email, PDF, link), share a link, and alerts when a number crosses a line.
ai_visibility — AI Visibility: how often AI assistants name the business, with the counts, who they name instead, what they get wrong, what to do next; set it up, change its questions, run a check (credits).
media_library — The Media page: list images and videos, folders, add a file from an https link, rename, move to a folder, share with or hide from the client's team.
website_widget — Website Widget: each widget's settings and numbers, the exact install line on the CRM's domain, change its settings, words and look.
ad_insights_cards — The Ad Insights cards and custom metrics (a name and a formula like AOV - CPA): which show, in what order, for one person or everyone.
reward_games — Reward Games: games where every play wins a coupon, sent to past customers. Results, make or change one, who a send reaches, send it at a pace, a test link, mark a coupon used. Never tied to reviews.
manage_invoices — Invoices: make a draft (lines, tax, discount, deposit, due date), change it, delete it, text or email it to the lead, mark it paid.
custom_values — Custom values: the business's own words used in every message as {{custom_values.<key>}}. List them, add one, change its value, name or folder, delete one.
review_pages — Add a review page (blank or a copy of another, off until turned on) or delete one.
website_widgets_manage — Add a website widget (a chat assistant or a booking widget) and get its install line, or delete one.
short_link_settings — Short Links settings: saved UTM sets, saved pixels, the domain new links start on and the look new QR codes start from.
manage_google_ads — Change its Google Ads: a new Search campaign (always created paused), typed changes (pause or turn on, budgets, bids, keywords, negatives, ads, settings), history and undo, Google's recommendations, free suggestions, the AI review, Autopilot, location search and keyword ideas. Turning things on, raising budgets or bids, applying recommendations and Autopilot spend real ad money: confirm with the user first.
smart_pages_more — More for one Smart Page: duplicate it, list its versions and restore one, read and set the SEO of each of its pages, clear, pause or resume its build queue, and read its database connection.
smart_forms_more — More for one smart form: read and set its tracking ids (Meta pixels, Google Analytics, TikTok, Google Ads), the coupon on its thank-you page and how people pick a time on it, copy it into another sub-account, and list the sub-account's own form and page domains.
website_analytics_details — Website Analytics in detail: pages with views per device, one page's click and scroll numbers, recorded visits (most worth watching first) and one visit's pages and markers, star a recording, forms and where people stop, a funnel, who is on the site now, and the tool's settings (recordings, hide all words, websites, thank-you pages).
google_desk_tasks — The Google desk: what waits on Google Business Profiles (replies and posts to approve, reviews with no reply, photos, connections to fix), everything that went out (posts, replies, photos, reports) and 12 weeks of results, for one sub-account or for every client at once.
ad_comments — The comments on a sub-account's Facebook and Instagram ads: list them with the AI's suggested replies, reply as the Page, hide, delete or set aside, act on many at once, read new ones now, and set what the AI does by itself.
delete_media — Delete a file from a sub-account's Media page, for good.
google_photos — The Google photo line: list a profile's photos and where each stands, add one from an https link, approve a customer's or crew's waiting photo, and remove one (off Google too when it's already there).
call_settings — Call recording and voicemail: whether calls are recorded and which kinds, the announcement callers hear first, voicemail on or off, a typed greeting or back to the standard one.
notification_settings — A sub-account's alert switches (new appointments, forms started and never sent, marking appointments done, the morning outcome digest) and the alerts of the person the key belongs to.
email_senders — Email sender identities: list them, add one on a verified sending domain, change its From name, signature or the default, delete one.
instant_lead_connect — Instant Lead Connect: read and change its settings (on or off, which leads, who rings in what order, ring times, quiet hours, retries, whispers) and read its call history. It never starts a call.
phone_number_settings — Change one phone number: its name, call forwarding, who it rings one after another, the teammate it belongs to and what technicians may do with it. Forwarding and the ring order change where real calls go.
google_profile_automation — The automatic switches on a Google Business Profile: review replies, posts and photos. Turning one on makes replies, posts or photos go to the public Google profile later by themselves, with nobody approving each one.
my_booking_link — The personal booking page of the person the key belongs to: read it, make it, change its link name, title, length, notice, meeting type, or pause it.
ai_calling — AI calling: make a campaign as a draft, read, change or delete one, count who a set of audience rules would call, and read or change the always-on AI caller's settings. Starting or resuming a campaign is done in the app.
text_campaigns — AI texting campaigns: list them, read one with who it would text now, make one as a draft (from a ready-made audience or your own rules, its goal, offer and AI instructions, own texts or AI-written ones, follow-ups, texting hours), change, copy or delete one, count who a set of rules would text, write a sample text for a real lead, see who is in it and take someone out, pause or finish it. Starting one texts real people: it needs confirm: true after the person said yes.
ai_agents — AI Agents: named assistants that watch a connected email inbox, sort new mail and answer customers. List, create, change (instructions, signature, on / off, approve or auto replies, booking, daily limit) and delete agents, read the emails each one looked at and what it did, try one on a made-up email, send or dismiss a drafted reply, retry a failed email.
call_campaign_start — DANGEROUS: places real phone calls and spends credits. Start or resume an AI calling campaign, or call its leads again. Refused without confirm: true, which is sent only after the user said yes to real calls.
invoice_payment_link — Make an invoice's card payment page on the business's own connected payment processor; an earlier unpaid page for it is cancelled.
smart_page_forms — A Smart Page's lead forms and what each does after it's sent (thank-you card or redirect), plus the builder's free edits: retype text and style or remove an element by id.
manage_meta_ads — Pause or turn back on an ad or a campaign in a sub-account's Meta ad accounts, and change a campaign's daily or lifetime budget. Only what the sub-account's dashboard shows, inside what the agency allows its client.
smart_pages — Smart Pages: landing pages and small websites with lead capture. List them, create one from a brief (the AI builder builds it), ask the builder for changes in plain words (content, design, sections, extra pages), follow builds, write a document's HTML yourself, change the name, link and SEO, publish, unpublish, delete.
smart_form_editor — One smart form in full: read everything (questions, design, screens, link, embed code for a website), change its design (fonts, colors, hero, sections) and its screens (welcome, contact, thank-you, screened-out), duplicate it, delete it.
loyalty_cards — Loyalty Cards: digital stamp cards, points, cashback, VIP levels, memberships, visit packs, coupons, gift cards and event passes in Apple Wallet and Google Wallet. Make and change programs, give and send cards, add stamps and purchases, use and give rewards, set balances, undo, import members, and send notes to card holders' lock screens. Free; never tied to reviews.
short_links — Short Links: free short links and QR codes. Make one or many, change where one goes, tags, UTM, end dates, passwords, phone and country links, A/B splits, numbers (clicks, scans, places, devices, sources) and the business's own short domain.
surveys — Feedback surveys: answers per question, make one from a start, send by itself when a deal is Won or Lost, send to people now, one lead's personal link.
google_tools — More Google tools: the Google profile itself, read and edited by hand (website, phone, hours, description, services, categories, Book link, social links, opening date), report emails, their settings and a note on the next one, holiday hours, website embeds of reviews, photos, posts, FAQ and schema, the owner's connect link, the crew's photo link and PIN, a profile's local knowledge, reply words and geotags, and a review page's words.
CRM leads
list_recent_leads — Leads, newest first. Filter by tags (any or all), status, stage, assignee (a user id, me or unassigned), a name/email/phone search and since.
list_lead_tags — A sub-account's lead tags and how many leads carry each.
manage_tags — Make a tag, rename or recolor one, merge tags into one, or delete one. Automations follow renames and merges.
get_lead — One lead with its inquiry, address, custom fields, tags and timeline.
create_lead — Create a lead with inquiry, address, custom fields, stage and tags (de-duplicated by phone and email).
update_lead — Update any lead field, custom fields and stage; add, remove or replace tags.
delete_lead — Delete a lead, and its appointments too if asked (admin scope).
get_lead_timeline — Everything that happened with a lead.
add_lead_note — Add a note to a lead, tagging teammates (@mentions) if you like.
set_lead_stage — Move a lead to a pipeline stage.
manage_lead_note — Edit a note you wrote, or delete a note.
mark_do_not_contact — Stop all texts and emails to a lead (no undo).
list_pipeline_stages — The sub-account's pipeline stages.
manage_deals — Deals in extra pipelines: list, get, put a lead in a pipeline, move or change a deal, take it out.
leads_bulk — Many leads at once: import a list quietly (nothing is sent or started), add or remove tags, set the stage, assign, mark as existing customers, or delete, up to 500 a call.
merge_leads — Merge duplicate leads into one: blanks on the kept lead are filled, tags, timeline, appointments, estimates and invoices move over, and the merged leads are deleted. Cannot be undone: confirm with the person first.
Messaging
send_lead_message — Send a text or email to a lead, now or at a later time (send_at), or reply to their Instagram or Messenger DM.
get_lead_conversation — The conversation with a lead: texts, emails, Instagram and Messenger DMs, calls and notes.
list_messages — Message history across the sub-account, Instagram and Messenger DMs included.
instagram_messenger — Instagram & Messenger: the connected accounts, the comment log of the comment-to-DM rules, who goes into Leads from a DM, and moving DM people from before back to Messages.
appointment_emails — The booked, moved and cancelled emails leads get: ours or the business's own HTML, subject, on or off, language.
get_message — One message with its delivery status.
get_message_limits — Today's sending limits and what is left.
manage_imessage — iMessage through the sub-account's own Macs: list_lines (health, Advanced mode, usage), update_line, send (a text or voice message as iMessage from one of them), react (a tapback on an iMessage).
comment_to_dm_rules — Comment to DM rules: when someone comments on the business's Instagram or Facebook post, reply under the comment and send them a private message. List, create, change, switch off and delete rules, with the editor's own limits.
Email marketing, contracts & proposals
email_campaigns — Email Marketing: list with results / get, create a draft (the AI writes it from a brief, or your content), update, send (now, scheduled, or a few at a time) to everyone / not booked / stages / tags, cancel, send the rest, duplicate, delete.
contracts — Contracts for e-signature: list / get / templates, create a draft for a lead (from a template or text), get the signing link without sending, send it, void it.
proposals — Proposals, your agency's own or a sub-account's: list / get (words, pricing, blanks, the AI's progress, the whole document), create one the AI writes from a brief, from a template (filled in or rewritten for the client), or from your own HTML and CSS (no AI; or straight as a template), change it yourself (update) or with the AI (edit), get the link without sending, send it, duplicate it (as a template, or for another client). design_guide has the rules for your own HTML.
contract_templates — A sub-account's contract templates: read one whole, create one from HTML or plain text with {{blanks}}, change it, delete it. The text is cleaned before it is saved.
Bookings
list_calendars — Booking calendars with their pricing, design and booking form.
get_calendar_availability — Open appointment slots, for the option and add-ons picked.
list_bookings — Appointments.
create_booking — Book an appointment, with the option and add-ons picked.
reschedule_booking — Move an appointment.
cancel_booking — Cancel an appointment.
update_booking — Record an appointment's outcome, change its title, notes, location, host or lead notifications, or link a hand-typed appointment to its lead.
Sub-accounts & team
list_workspaces — Your sub-accounts.
get_workspace — One sub-account.
update_workspace — Rename, re-time-zone or archive a sub-account; turn optional features on (Settings > Features) or hide features from its people.
list_workspace_members — Members and pending invites.
invite_workspace_member — Invite someone to a sub-account (admin scope).
update_workspace_member_role — Change a member's role (admin scope).
remove_workspace_member — Remove a member (admin scope).
crm_connections — A sub-account's connected job software and CRM tools (what each syncs, its last error; never a key), which of them already have a lead, and Push to CRM: send one lead to one tool now without ever making a second record there.
email_domains — A sub-account's own email sending domain: list domains with the DNS records to add, add one, check its records again, pick the default, remove one.
refer_and_earn — A sub-account's Refer & earn page: its own referral link, the reward it earns, the people it referred and its rewards with their status. Read only.
Forms & automations
list_smart_forms — Smart forms with views and submissions.
list_form_submissions — Submissions of a form.
list_workspace_automations — A sub-account's automations.
automation_folders — Folders on the Automations page: list, create, rename, delete (automations stay), move automations in or out.
enroll_leads_in_automation — Enroll leads in an automation (can send real messages). Leads already queued for it are skipped; ignore_filters defaults to false, so leads failing its only_if rules are skipped.
toggle_workspace_automation — Turn a sub-account automation on or off.
manage_workspace_automation — Build automations and read how they did: reference / email_design / get / results / create / update / duplicate / delete (changes need admin scope). Triggers can name Smart Forms, calendars and Facebook forms; email steps can pick a sender and be simple, designed (sections and a look, in the business's brand) or the business's own HTML; inbound webhooks return their URL.
workflow_enrollments — Who is in an automation, a lead's automations, and taking leads out.
Meta
meta_lead_forms — Facebook and Instagram Lead Forms that feed a sub-account's Leads: the connected Pages and their forms, connect or disconnect a Page, turn forms on or off, and sync past leads from Meta (alerts and first texts only when asked).
lead_quality_feedback — Lead quality feedback, read only: the Meta dataset a sub-account's lead stages are sent back to, whether it is on, and the newest events sent or failed.
lead_feedback_datasets — Lead quality feedback's dataset: list the datasets on the sub-account's ad accounts, make a CRM dataset, or connect one. A saved dataset is only changed with replace.
meta_lead_form_setup — Setting up Facebook and Instagram Lead Forms: the Facebook Pages that can be connected, a connected Page's forms read from Meta now with their questions, and one form's settings (which lead field each question goes to, the business number that texts its leads, the calendar they book on, on or off).
Smart forms
site_domains — A sub-account's own domains for its Smart Forms and Smart Pages: list them, add one (answers the DNS record to create), check it, remove it, and put a Smart Page on a verified domain or back on its shared link.
Errors
Status
Meaning
What to do
400
Invalid request body or unknown action.
Fix the payload; retrying unchanged returns the same error.
401
Missing, malformed or revoked API key.
Re-copy the key from Settings → API.
402
The account is out of credits for this message or call, or the key's monthly credit budget is used up.
Add credits to the account, or raise the key's budget in Settings → API.
403
The key lacks the scope for this endpoint. details.codeaccount_locked: this account is locked (paused, or its plan unpaid or ended), so its API keys stop until it opens again.
Create a key with that scope in Settings → API; the response names the scope it needs. For account_locked, an admin of the account opens the CRM to see why and unlock it.
404
Unknown route or record.
Check the path and the id.
409
Conflict, e.g. a lead with that phone or email already exists, or the lead is already booked at that time. Also idempotency_in_progress: the first request with this Idempotency-Key is still running.
Use the id returned in details. For idempotency_in_progress, send the request again with the same key a moment later.
429
Per-key rate limit exceeded.
Wait for Retry-After seconds; read X-RateLimit-Remaining.
503
Pricing or a limit check is temporarily unavailable. Nothing was charged.
Retry with exponential backoff.
5xx
Transient server or upstream failure.
Retry with exponential backoff.
Limits and conventions
Authentication
Send your key as Authorization: Bearer zu-.... Admins of a sub-account create keys in the CRM under Settings → API. A key works inside its own sub-account only: you can leave out workspace_id everywhere, a different one is ignored, and records of any other sub-account answer 404. Access levels: Read only, Read and write, or Full access (deleting things, team members and anything that sends lead data outside the account). Every call also follows the role of the person who made the key: a key keeps working only while they are an admin of the sub-account.
Idempotency
Every write (POST, PUT, PATCH, DELETE) accepts Idempotency-Key: <your-unique-string>. Replaying the same key with the same body within 24 hours returns the original response instead of doing the work twice (no second message, no second booking); the same key with a different body answers 409. Use a fresh key per logical operation, not per retry.
Rate limits
Every response carries X-RateLimit-Limit and X-RateLimit-Remaining. On 429 a Retry-After header (and retry_after_seconds in the body) tells you how long to wait. The limit is per key, per minute: 120 by default, adjustable from 1 to 600 in Settings → API.
Pagination
List endpoints accept limit (default 50, max 200) and return the newest rows first. GET /v1/messages is the one endpoint with a cursor: pass cursor (or since) and follow next_cursor to walk forward without duplicates.
Messaging safety limits
To protect number reputation, each sub-account can message at most 300 unique contacts per UTC day (plus per-minute burst and daily segment caps). Replying to a contact you already messaged that day does not consume another contact slot. Messaging endpoints return X-Contacts-Limit, X-Contacts-Used, X-Contacts-Remaining and X-Contacts-Reset; over the cap sends answer 429 with code: "sms_limit" and a limit object. Check the current state any time with GET /v1/messages/limits. Need a higher ceiling? Request a limit increase from Settings → Messaging and we'll review it.
Responses and errors
Success is { success: true, data, error: null }. Errors are { success: false, data: null, error: string, details?: object } with a matching HTTP status; scope, rate-limit and budget errors put a machine-readable code in error (scope_denied, rate_limit_exceeded, credit_limit_exceeded) and the explanation in message. Branch on the status and the code, not on message text.
Webhooks
Get events pushed to your own URL: set a webhook up in Settings → Leads → Outbound webhooks, or with POST /v1/outbound-webhooks below.
Event
When it fires
lead.created
A lead was captured for this sub-account. Payload is a full lead snapshot including custom form fields.
lead.updated
The lead's status or pipeline stage changed (other field edits do not fire it). Payload carries previous_status, status, previous_stage_key and stage_key.
lead.qualified
The lead was marked qualified.
appointment.booked
An appointment was booked for the lead.
appointment.rescheduled
An appointment moved to a new time, in the CRM calendar, through the API, by an inbound webhook or by the customer on their appointment page. Payload carries booking_id, lead_id, the new starts_at / ends_at, timezone, host, calendar, meeting and moved_via (app, api, inbound_webhook or customer).
appointment.cancelled
A booked appointment was cancelled.
message.received
An inbound SMS or email arrived on this sub-account's number or inbox. Payload carries message_id, lead_id, channel, direction, body, from/to and media_urls, and transport (imessage or mac_sms) when it came in on one of the sub-account's iMessage Macs.
message.sent
An outbound SMS or email was handed to the carrier or mail provider — manual, automated or API-sent. Texts carry transport: sms from the business number, imessage or mac_sms when one of the sub-account's Macs sent it.
message.failed
An outbound message could not be sent. Payload includes the error and, when the contact-safety cap was hit, a limit object.
call.completed
An AI receptionist call ended (once per call, after its recap is written; practice calls from Settings excluded). Payload carries call_id, lead_id (null for a caller with no lead), from/to, status, duration_sec, outcome, summary, booking_id and started_at / ended_at. The transcript and recording: GET /v1/calls/{call_id}.
deal.updated
A lead was marked won, or a won lead's amount or plan changed later (an amount added from Ad Insights, a plan edited). Payload carries deal_type (one_time or plan), deal_value_cents (the first payment), deal_plan_cents, deal_plan_interval, deal_monthly_cents and deal_expected_total_cents, plus the lead snapshot. Every lead event's snapshot carries the same deal fields.
Verify each delivery: X-Webhook-Signature: sha256=<hex hmac>. Each delivery is signed with HMAC-SHA256 over the exact raw request body using the webhook's secret (shown once when it is created). Compute the HMAC over the raw bytes, before JSON parsing, and compare in constant time. X-Webhook-Event carries the event name and X-Webhook-Delivery a unique delivery id you can use to de-duplicate retries.
Start here. Returns the sub-account's real configuration (numbers, AI texting, receptionist, calendars, forms, automations, offers, team, lead sources, integrations) and a severity-ranked list of findings. Each finding names the API call and MCP tool that fixes it, or says when it can only be done in the app (buying a number, SMS registration, connecting Google or Outlook).
The people a sub-account's emails come from (Settings > Email > Sender identities): each has a mailbox name (local_part), its address on one of the sub-account's verified sending domains, a From name, whether it is the default, and signature_html when it has a signature of its own (null = it uses the sub-account's main signature). domains lists the verified sending domains a sender can be on. People who manage the sub-account.
A new sender identity, as the app's Add saves it. local_part is the mailbox name before the @ (made lowercase, spaces become dots, only letters, digits, dot, dash and underscore kept). The address is always on one of the sub-account's verified sending domains: domain_id picks one, else the main one; 409 when the sub-account has none yet (verify one in the app, Settings > Email). display_name defaults to 'Sarah at <business>'. The first sender becomes the default; is_default: true moves the default to this one. signature_html is the sender's own signature ({agent}, {business} and {city} are filled in per email): anything in it that runs is taken out when saved (scripts, frames, forms and style blocks, on... handlers, links and pictures that aren't http(s), mailto, tel or an image), up to 50,000 characters. Up to 50 senders; 409 when the address already exists. People who manage the sub-account.
Parameter
Description
local_part
body · string · required
The mailbox name before the @ (sarah).
display_name
body · string
The From name, up to 64 characters.
domain_id
body · string
One of the verified sending domains (GET /v1/email-senders domains).
signature_html
body · string
The sender's own signature as HTML; leave out to use the main signature.
Only what's sent changes: display_name, domain_id (a verified sending domain of the sub-account), signature_html (cleaned as on create; null goes back to the main signature), is_default: true (makes it the default; to change the default, make another sender the default). The mailbox name never changes: delete the sender and add another. People who manage the sub-account.
Parameter
Description
sender_id
path · string · required
Sender id.
display_name
body · string
The From name.
domain_id
body · string
A verified sending domain.
signature_html
body · string
The sender's own signature as HTML; null to use the main signature.
Settings > Phone > Edit on a number, and who uses it (Team). Only what's sent changes. friendly_name. Call forwarding: forward_to (a phone number, or null to clear it), forward_enabled (400 with nothing to forward to), forward_caller_id (line: the forwarded phone sees the business's number; caller: the caller's own). ring_order: who the number rings one after another instead of everyone at once, { on, screen, steps: [{ seconds: 10-60, targets: [{ kind: "member", user_id, app, phone } | { kind: "phone", phone, label }] }] }: up to 8 steps of up to 5 people and 180 seconds in all; screen makes a phone that answers press 1 to take the call; null clears it; refused when a step names someone off the team or one of the business's own numbers. assigned_user_id gives the number to one teammate (it rings only them; null shares it with everyone; 400 for someone off the team), tech_can_answer and tech_can_use say whether it rings technicians and whether they may call and text from it. Forwarding and the ring order change where real calls go from the next call on. The answer is the number as GET /v1/phone-numbers lists it plus voice_forward_caller_id and has_forward_to: the forwarding number and the ring order's phones are never returned. Buying and releasing numbers, and a number's own voicemail greeting, stay in the app. People who manage the sub-account.
Parameter
Description
phone_number_id
path · string · required
The number's id (GET /v1/phone-numbers).
friendly_name
body · string
The number's name, up to 64 characters.
forward_to
body · string
The phone calls forward to; null clears it.
forward_enabled
body · boolean
Forward calls nobody answers in the app.
forward_caller_id
body · string
What the forwarded phone sees.
One of: line, caller
ring_order
body · object
{ on, screen, steps: [{ seconds, targets }] }; null clears it.
assigned_user_id
body · string
The teammate the number belongs to; null for everyone.
Send only what changes. A new time zone also moves the booking hours' time zone, as in the app.
Parameter
Description
name
body · string
Max 120.
industry
body · string
Max 80.
timezone
body · string
IANA zone, e.g. America/Chicago.
address_line1
body · string
Street.
address_line2
body · string
Suite, unit.
city
body · string
City.
state
body · string
State or region.
postal_code
body · string
ZIP or postal code.
country
body · string
Two-letter country code (US, CA, GB, AU; "United States" works too), or null. It picks the State list on leads, forms and booking pages, and the list a lead's state is matched against when the lead has no phone.
Number, name, default, capabilities, texting registration and caller-name status, and who may use it: assigned_user_id (a number that belongs to one team member: it rings only them and other technicians can't text from it), tech_can_answer and tech_can_use (whether it rings technicians and whether they may call and text from it), and ring_in_order (its calls ring the team one after another, set in the app under Settings > Phone). Buying and releasing numbers is done in the app. iMessage Macs: GET /v1/imessage/lines.
Read only. The business's A2P registration with the phone carriers, as the business sees it in Settings > Phone: kind (business or sole_proprietor), status (draft, brand_pending, needs_code, campaign_pending, approved, needs_fix, on_hold or closed), whose_move (you, us, carriers or nobody), message and needed in plain words, reasons when it was turned down (each with what to fix), and whether the business's numbers are on its own registration yet. registration is null when none was started. texting_live, numbers and numbers_ready say whether a number can text now, the same reading as texting_ready on GET /v1/phone-numbers; a status can be up to about 10 minutes old. Filing or fixing a registration and buying a number stay in the app on purpose: they take the business's legal details and a fee that isn't refunded. A tax ID or personal cell number is never returned. Owners and admins only.
Read only. A number in a country whose regulator wants paperwork is an order the carrier reviews before it exists. Newest first: country, number, status (review, needs_fix, active or cancelled), whose_move (you, us, carriers or nobody), message and needed in plain words, and each requirement's name, type and status (approved, turned_down or waiting). Buying a number and sending or fixing its paperwork stay in the app on purpose. Countries with no paperwork have no order. Owners and admins only.
Offers (offer playbooks) tell the AI what this business sells to a lead: the first text, the follow-up sequence, notes for the AI and the booking link.
First text to a new lead. Supports {{first_name}} (max 1600).
nurture_enabled
body · boolean
null follows the sub-account's own follow-up setting.
nurture_steps
body · array
Up to 12 follow-ups: { offset_minutes, body_template }. offset_minutes counts from the previous message.
ai_context_note
body · string
What the AI should know about this offer (max 2000).
booking_link
body · string
Public http(s) URL.
is_active
body · boolean
Default true.
smart_first_text_enabled
body · boolean
true: the AI writes the first text for these leads (first_message_template is the backup); false: first_message_template goes out as written; null (default) follows the sub-account's smart first text switch.
smart_first_text_instructions
body · string
What the smart first text should do for these leads (max 1000). Empty uses the sub-account's instructions.
triggers
body · array
Which leads get this offer: { type, value, label? }. type is meta_form, smart_form, webhook (a lead source id) or source (the lead's source text). Form and lead-source ids must belong to the sub-account.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/offers" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"name": "Free roof inspection",
"offer_label": "a free 20-point roof inspection",
"first_message_template": "Hi {{first_name}}, thanks for asking about a free roof inspection. What day works best?",
"nurture_steps": [
{
"offset_minutes": 60,
"body_template": "Still want that inspection?"
}
],
"triggers": [
{
"type": "source",
"value": "Website form"
}
]
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/offers", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
name: "Free roof inspection",
offer_label: "a free 20-point roof inspection",
first_message_template: "Hi {{first_name}}, thanks for asking about a free roof inspection. What day works best?",
nurture_steps: [
{
offset_minutes: 60,
body_template: "Still want that inspection?",
},
],
triggers: [
{
type: "source",
value: "Website form",
},
],
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/offers",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"name": "Free roof inspection",
"offer_label": "a free 20-point roof inspection",
"first_message_template": "Hi {{first_name}}, thanks for asking about a free roof inspection. What day works best?",
"nurture_steps": [
{
"offset_minutes": 60,
"body_template": "Still want that inspection?",
},
],
"triggers": [
{
"type": "source",
"value": "Website form",
},
],
},
)
print(res.json())
A new calendar has no host unless host_user_id or hosts is sent. Hosts must be members of the sub-account (GET /v1/members). The response is the calendar as GET /v1/calendars shows it, with its public booking path (/c/<slug>). Calendars are switched off with is_active=false rather than deleted. The booking page can show prices with options and add-ons and take a deposit (pricing), have its own look (design), book whole working days (duration_days), share one schedule with other calendars (schedule_group) and ask its own questions (questions). Taking money at booking needs Stripe, Authorize.net or Whop connected to the sub-account in the app first.
Parameter
Description
name
body · string · required
Calendar name (max 80).
title
body · string
Shown to the person booking.
duration_minutes
body · number
5-1440, default 30.
buffer_minutes
body · number
0-1440, default 0. Always saved as 0 on an arrival_window calendar (a window books the whole window and pads nothing), as in the app.
min_notice_minutes
body · number
Default 60.
max_days_ahead
body · number
1-365, default 14.
timezone
body · string
IANA zone, e.g. America/Chicago. Defaults to the sub-account's.
weekly_hours
body · object
Per day, 24h HH:MM windows: {"mon":[["09:00","17:00"]],"sat":[]}. Default Mon-Fri 9-5.
date_overrides
body · array
Days off or special hours: [{"date":"2026-12-25","pairs":[]}].
assignment_mode
body · string
Who takes the booking. Default unassigned (no host), or single when host_user_id is sent.
One of: single, round_robin, collective, unassigned
host_user_id
body · string
Host of a single-host calendar (required for single).
hosts
body · array
User ids sharing a round_robin / collective calendar.
meeting_type
body · string
Default phone. in_person: the customer comes to meeting_location (studio, shop, office). customer_address: the team goes to the customer's home, and the booking page asks for their address.
One of: zoom, google_meet, phone, phone_attendee, in_person, customer_address, custom
scheduling_mode
body · string
exact times, or an arrival window for trades.
One of: exact, arrival_window
arrival_window_minutes
body · number
15-720.
appointment_texts
body · object
Confirmation and reminder texts for appointments on this calendar, keyed by confirmation, reminder_24h, reminder_1h, reminder_5m. Each takes {"mode":"custom","template":"..."} (this wording, sent even when the sub-account has that text off), {"mode":"off"} (never sent for this calendar), or null / {"mode":"inherit"} (the sub-account's text, the default). Only the texts you name change.
slots_per_window
body · number
1-50: how many jobs can run at the same moment (crews).
duration_days
body · number
Full-day jobs, 1-14 working days: each booking runs from opening time on its first day to closing time on its last, skipping closed days. null = timed by duration_minutes.
schedule_group
body · string
Shared schedule name (max 60): calendars with the same group count each other's bookings, so one crew's time is never sold twice across services. null = its own schedule.
booking_requests
body · object
Bookings on this calendar are requests until someone confirms them, merged: {"on":true,"ai_confirms":true,"ai_rule":"They own the home and will be there","message":"We'll confirm within the hour."}. While on, a booking made by itself (booking page, Smart Form, the AI, this API) is saved held: the time is taken, but no confirmation, reminders or invite go out and "Appointment requested" automations run instead of "Appointment booked". The team confirms or declines it on Appointments; with ai_confirms (needs ai_rule, max 600) the AI texter may confirm it once the rule is met. message (max 300) is what the booking page says after a request. Bookings a person makes by hand and existing customers' are never requests. The API does not show the hold yet: a held request reads as status confirmed in GET /v1/bookings, and confirming or declining it is done on the Appointments page. null = off.
pricing
body · object
Prices on the booking page. Merged into what the calendar has, except options and addons, which replace their lists (send each row's id to keep it; ids come back in GET /v1/calendars). Money in cents. { enabled, show_prices, price_cents (no options), price_note (max 160), options_label ("Vehicle size"), options: [{ id?, name (max 80), description?, price_cents, duration_minutes (5-1440, its own job length), duration_days (full-day calendars), image_url? }] (max 24; the customer picks one), addons_label, addons: [{ id?, name, description?, price_cents, extra_minutes (0-720), image_url? }] (max 24), deposit: { mode: none | fixed | percent | full, amount_cents, percent (1-100) } }. A calendar that never had pricing switches it on unless enabled is false; null clears it. A deposit needs a connected gateway.
design
body · object
The booking page look, merged into the current design. { enabled, preset (clean, studio, showroom, midnight, clinic, fresh, warm, editorial, sunset, bold, ocean, builder, spa, lavender, mono, forest, graphite: applied first; it sets the whole look, layout included), mode: light | dark | auto, colors: { background, surface, text, button } (#rrggbb, merged), font, heading_font ("match" or a font), radius: sharp | soft | rounded | pill, button_style: solid | soft | outline, backdrop: solid | glow | gradient | dots | photo (the cover, needs cover_url) | image (needs background_url), layout: card | split (details beside the calendar on computers) | open (no card), header_align: left | center, logo_size: small | medium | large, day_style: tiles | strip | calendar (windows over three weeks always show the calendar), time_style: grid | list | pills, picked_style: tint | filled, shadow: none | soft | lifted, heading_case: normal | upper, logo_url, cover_url, background_url (https), hide_avatar, show_counts, group_times, labels: { pick_day (40), pick_time (40), done_title (60), done_text (240) } ("" = the usual words, merged), custom_css (max 12000) }. Fonts: inter, poppins, dm-sans, space-grotesk, manrope, outfit, figtree, plus-jakarta, work-sans, rubik, nunito-sans, montserrat, raleway, urbanist, sora, lexend, archivo, barlow, karla, public-sans, bricolage, bebas, anton, archivo-black, syne, clash, oswald, playfair, dm-serif, lora, libre-baskerville, cormorant, instrument-serif, fraunces, source-serif, merriweather, jetbrains-mono, space-mono, ibm-plex-mono, system. A page that never had a design switches it on unless enabled is false; null = the classic page. It carries into embeds and custom domains.
questions
body · array
The calendar's own booking questions, up to 30, replacing the list: [{ key?, label (max 160), field_type: text | textarea | number | money | phone | email | url | select | multiselect | boolean | date | datetime | rating | file (photos or PDFs, up to 6), options (select / multiselect: 2-40), option_style?, required?, enabled?, save_to_crm? (never for file), placeholder?, helper_text? }]. Answers show on the appointment and the lead.
fields
body · object
Contact fields on the booking form, merged: {"address":{"enabled":true,"required":true,"autocomplete":true},"email":{"required":false}}. Keys: full_name, first_name, last_name, email, phone, address, state, notes. Phone or email stays on; full_name or first_name + last_name.
image_url
body · string
The service's photo (https): on its booking page and its service menu card.
currency
body · string
Prices and payments in this currency.
One of: usd, cad, gbp, eur, aud
payment_gateway
body · string
Charge through this connected gateway; null = whichever is connected (Stripe first).
One of: stripe, authorize_net, whop
payment_hold_minutes
body · number
15-120: how long the time is held while they pay.
payment_label
body · string
What the checkout calls the payment, e.g. "Deposit" (max 60).
Takes the same fields as create; send only what changes. hosts, when sent, replaces the pool; people who stay keep their place in the rotation. An arrival_window calendar always keeps buffer_minutes at 0 (a full-day one keeps its buffer). appointment_texts changes only the texts it names. pricing, design and fields merge; pricing.options, pricing.addons and questions replace their lists. Turning pricing off also stops taking payment at booking.
The Design tab's "Use on other calendars": this calendar's design goes onto the calendars named (or every other calendar of the sub-account with all: true), switched on. A calendar that has its own cover photo keeps it. The calendar must have a design switched on.
The Design tab's AI designer: describe the look in one line and/or give the business's website (its colours, fonts and logo are read from it). Returns the design and a one-line summary, and saves it on the calendar unless save is false. readable says whether the text reads well on the card. No credits used.
Parameter
Description
calendar_id
path · string · required
Calendar id.
instruction
body · string
What it should look like, e.g. "black and gold, like a luxury showroom" (max 1200).
website_url
body · string
The business's website.
save
body · boolean
Default true. false only returns the design (send it later with PATCH design).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/calendars/CALENDAR_ID/design/generate" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"instruction": "black and gold, like a luxury showroom",
"website_url": "https://example.com"
}'
Service menus (Calendars → Booking tools → Service menu): one booking link (/c/<slug>, public_path) that lists several calendars in sections, with search, category chips and sorting; the customer picks a service and books it there. Each section lists its services with their price and length as the page shows them. warnings says when its services are on separate schedules (two customers could book the same time on different services) or switched off.
Without sections it starts like the app's: one "Services" section with every calendar that is switched on, and a link named after the business. The link shares /c/ with calendars, so a slug a calendar or another menu uses answers 409.
Parameter
Description
title
body · string
Heading customers see (max 120). Default "Book a service".
name
body · string
Internal name (max 80). Default "All services".
description
body · string
Under the heading (max 600).
slug
body · string
Link name: /c/<slug> (letters, numbers, dashes; max 40).
sections
body · array
In order, replacing the list: [{ id?, title (max 80), description?, calendar_ids: [calendar ids, in the order shown] }]. Up to 30 sections; every calendar must belong to the sub-account.
options
body · object
Merged: { show_prices, show_durations, search, filters (category chips), sorting, default_sort: featured | price_low | price_high | shortest | name }. All on by default.
design
body · object
The page look, the same shape as a calendar's design. It carries into each service's booking flow opened from the menu.
The menu editor's "Share one schedule": every calendar on the menu gets the same schedule_group, so a booking on any of them takes that time on all of them (one crew doing every service). group names it; by default the group one of them already has, else the menu's title.
Calendar routing (Calendars -> Calendar routing in the app) sends each lead to the calendar that fits their answers: "Player group is Girls 13-14 -> Girls 13-14 calendar". Rules are checked in order (position 1 first); the first rule whose conditions ALL match the lead's custom fields or tags picks the calendar. Smart Forms with calendar_routing on, the AI texter and the AI caller follow them. Each rule comes with its calendar's name and a readable summary. Rules that are switched off, or whose calendar is off, are skipped.
Added last unless you send position. Conditions: a field condition reads a custom field by key (GET /v1/custom-fields) with op is, is_not or contains and values (any one matches), or op between with min and/or max for numbers ("11 years old" counts as 11); a tag condition (kind tag, op is or is_not) reads the lead's tags. Answers compare ignoring case, accents and punctuation. The calendar must belong to the sub-account. warnings explains a rule that may never fire (a key that is not a custom field, a calendar that is switched off). Owners and admins only; at most 200 rules.
Parameter
Description
calendar_id
body · string · required
The calendar this rule books on (GET /v1/calendars).
conditions
body · array · required
All must match, 1-20: [{"kind":"field","key":"player_group","op":"is","values":["Girls 13-14"]}], [{"kind":"field","key":"age","op":"between","min":9,"max":12}], [{"kind":"tag","op":"is","values":["VIP"]}].
Send any of calendar_id, name, conditions (replaces the list) and is_active. To move a rule use POST /v1/calendar-routes/reorder. Owners and admins only.
The first rule that matches wins, so put narrower rules first. order lists every rule id of the sub-account exactly once, first to last. Answers the rules in their new order. Owners and admins only.
Runs the rules the way the booking paths do (active rules on calendars that are on) against a lead's custom fields and tags, and/or answers you pass. status: matched (calendar and the route that won), pending (no rule matched yet but one still can: missing_fields are the answers to ask for before offering times), unmatched (no rule fits: the form's or the AI's own calendar applies), or no_rules. Viewers limited to their own leads only reach those leads.
Parameter
Description
lead_id
query · string
The lead to route. Send lead_id, answers or both.
answers
query · string
JSON object of field key to answer to try, laid over the lead's own, e.g. {"player_group":"Girls 13-14"}.
The personal booking page of the person this key belongs to, in this sub-account (Calendars > My booking link): its url and settings, or booking_link: null when they have none. Never anyone else's. Anyone in the sub-account.
For the person this key belongs to, in this sub-account. With none yet it makes one as the app's Create does (a 30-minute 'Book a call', its link name from their name plus four random characters) with anything sent laid over it (201); otherwise only what's sent changes. slug is the end of the link (lowercase letters, numbers and dashes, up to 40) and one namespace for everyone: 409 when taken. title up to 60, duration_minutes 5-240, buffer_minutes 0-120, max_days_ahead 1-60, meeting_type zoom, google_meet, phone, in_person or custom (meeting_location is the address or link), confirm_button_text up to 40, is_active: false pauses the page. Their hours and connected calendars are set in the app. Anyone in the sub-account.
Parameter
Description
slug
body · string
The end of the link.
title
body · string
The page's title.
description
body · string
A few words under it.
duration_minutes
body · number
5-240.
buffer_minutes
body · number
0-120.
min_notice_minutes
body · number
How soon someone can book.
max_days_ahead
body · number
1-60.
meeting_type
body · string
Where it happens.
One of: zoom, google_meet, phone, in_person, custom
For a schedule kept in other software (a field-service app, a dispatch board): the person is treated as booked for that time, so the AI (text, chat and phone), Smart Forms, booking pages and round robin only offer times when they are free. external_id is YOUR id for the block (a job or visit id, URL-encoded in the path); sending the same id again replaces the block, so it is safe to resend. A block can make several people busy (a two-tech job). Team members are named by user id or email (GET /v1/members); technicians must be invited as members first. Times need a time zone (Z or an offset). At most 31 days per block. 201 when created, 200 when replaced (changed: false when nothing differed). Owners and admins of the sub-account only.
Parameter
Description
external_id
path · string · required
Your own id for the block: 1-200 letters, digits or . _ : ~ @ # | + = -
team_member
body · string
The busy person: a team member's user id or email. Or team_members for several.
team_members
body · array
Several busy people (user ids or emails), up to 50.
starts_at
body · string · required
ISO 8601 with a zone, e.g. 2026-10-14T08:00:00-05:00.
ends_at
body · string · required
ISO 8601 with a zone; after starts_at.
title
body · string
Optional note shown to the team in the CRM calendar (never to leads or the AI), max 200.
Send your full list of busy blocks for a window: blocks in the list are added or replaced, and blocks you sent earlier that START inside [from, to) but are no longer in the list are removed (cancelled or moved jobs). With team_member, only that person's blocks are replaced and each block defaults to them; a removed block that also names other people keeps them. Up to 500 blocks per call. Good for a nightly or hourly full sync next to the per-block calls. Owners and admins only.
Pipelines next to the main one (GET /v1/stages), each with its stages in order. A stage's kind is open, won or lost; lead_stage_key, when set, is the main stage a deal's lead moves to when the deal lands there. Needs More pipelines on in Settings > Features (PATCH /v1/workspaces/{workspace_id} with enabled_features.pipelines); while it's off this answers 403 feature_off.
Owners and admins. Without stages it starts with New, In progress, Won and Lost. Up to 20 pipelines, 30 stages each; names are unique per sub-account. Needs More pipelines on in Settings > Features (PATCH /v1/workspaces/{workspace_id} with enabled_features.pipelines); while it's off this answers 403 feature_off.
Parameter
Description
name
body · string · required
Its name (max 60).
stages
body · array
Stages in order: {label, color, kind (open | won | lost), lead_stage_key}.
Deals in the extra pipelines, newest first, with their lead and stage. A Technician (or limited Staff) key sees only the deals of their own leads. Needs More pipelines on in Settings > Features (PATCH /v1/workspaces/{workspace_id} with enabled_features.pipelines); while it's off this answers 403 feature_off.
Owners and admins. Send stage_id, or pipeline_id to start in its first open stage. One lead can have several deals, even in the same pipeline. A stage with lead_stage_key moves the lead in the main pipeline too.
Parameter
Description
lead_id
body · string · required
The lead.
stage_id
body · string
Its stage.
pipeline_id
body · string
Instead of stage_id: start in this pipeline's first open stage.
name
body · string
What it is (max 120). Empty: the lead's name is shown.
value_cents
body · number
Its value in cents.
assigned_to
body · string
A team member's user id (GET /v1/members).
external_id
body · string
Another system's id, unique per sub-account (409 when taken).
stage_id moves it (any stage of the sub-account, so it can change pipeline). Moving into a won or lost stage closes it; a stage with lead_stage_key moves the lead too.
Settings > Custom values: the business's own words used across every text, email and automation (a webinar date, a booking link, a promo code). Each has a key, and token is what to paste into a message: {{custom_values.<key>}}. Change a value and every message that names it says the new thing on its next send. Different from custom fields, which hold one answer per lead. Any member.
The key comes from the name ("Webinar date" becomes webinar_date; a taken one gets _2, _3 ...) unless you send key, which must be free (409 otherwise). A sub-account keeps up to 500. People who manage the sub-account.
Parameter
Description
name
body · string · required
What the team calls it, up to 120 characters.
value
body · string
What messages say, up to 5,000 characters. Kept exactly as sent.
folder
body · string
A folder to keep it in, up to 60 characters.
key
body · string
The key in {{custom_values.<key>}}: lowercase letters, numbers and underscores, up to 64. Left out, it comes from the name.
Send what changes. Messages that name it say the new value on their next send. A saved key never changes, because messages already name it. People who manage the sub-account.
Parameter
Description
value_id
path · string · required
The custom value (GET /v1/custom-values).
name
body · string
Up to 120 characters.
value
body · string
Up to 5,000 characters.
folder
body · string
Up to 60 characters; null takes it out of its folder.
How NEW LEADS are handed to team members. Round robin assigns them in turn (a round-robin calendar is separate: it rotates appointment hosts): an empty eligible_member_ids list means everyone takes turns, and member_weights splits leads by percentage (80/20 gives one person 8 of every 10 leads, spread out); {} goes back to even turns. Grab it (grab_enabled) puts a Grab it link in every new-lead alert, and the first person to tap it gets the lead. Only one of the two is on at a time: turning one on turns the other off.
Parameter
Description
round_robin_enabled
body · boolean
Turn the rotation on or off.
eligible_member_ids
body · array
User ids from GET /v1/members. Empty = everyone.
member_weights
body · object
Percentage split by user id (GET /v1/members): {"<user_id>": 80, "<other_user_id>": 20}. Whole percents 0-100; the shares above 0 must add up to exactly 100. Sets eligible_member_ids to the people with a share and restarts the rotation. {} = even turns (keeps who is in the rotation).
notify_assignee_only
body · boolean
Alert only the person the lead went to.
skip_imported_leads
body · boolean
Leave imported leads unassigned.
notify_on_reply
body · boolean
Alert the assignee when the lead replies.
grab_enabled
body · boolean
Grab it: a Grab it link in every new-lead alert; the first person to tap it gets the lead. Turns round robin off.
grab_member_ids
body · array
Who can grab leads: user ids from GET /v1/members. Empty = everyone who works in the sub-account.
Lead details are sent to this phone or inbox, so this needs an admin-scoped key.
Parameter
Description
channel
body · string · required
sms or email.
One of: sms, email
destination
body · string · required
Phone (US 10-digit or +country code; stored as E.164) or email address.
label
body · string
e.g. Owner's cell.
notify_leads
body · boolean
Gets new-lead, appointment and reply alerts. Default true.
notify_calls
body · boolean
Gets a summary after every AI receptionist call (who called, the outcome, any message or booking, the transcript). Default false.
lead_sources
body · array
Lead alerts only about leads from these sources, e.g. ["site_widget"] for Website chat leads: meta_lead_ad, smart_form (started forms too), website_form, site_widget, webhook, api, instagram, messenger, sms_inbound, email_inbound, calendly, acuity, review_funnel, manual, import, other. [] = every lead (default). Call summaries are never filtered.
Send any of label, destination, active, notify_leads, notify_calls, lead_sources ([] = every lead). A recipient keeps at least one of notify_leads or notify_calls.
Settings > Notifications' switches for the whole sub-account: notify_on_appointments (alerts for new appointments), notify_on_partials and partial_notify_delay_minutes (alert about a form someone started and never sent, after that wait), auto_complete_appointments and auto_complete_grace_hours (appointments are marked done that long after they end), appointment_outcome_digest (the morning 'mark the outcome' digest). Anyone in the sub-account.
Change the sub-account's alert and outcome settings
PATCH/v1/notification-settings
Read and writeIdempotent
Only what's sent changes; what GET answers can be sent straight back. partial_notify_delay_minutes is one of 2, 5, 10, 15 and auto_complete_grace_hours one of 2, 12, 24, 48 (the app's own choices). Who is alerted about new leads is /v1/alert-recipients; each person's own alerts are PUT /v1/notification-settings/mine. People who manage the sub-account.
The alerts of the person this key belongs to, in this sub-account, never anyone else's: alerts { new_lead, lead_reply, incoming_call, appointment_booked, appointment_reminder, missed_call, delivery_failure, team_mention } (each on until they turn it off) and tap_opens_lead (tapping an alert opens the lead). Anyone in the sub-account.
Turns alerts on or off for the person this key belongs to, in this sub-account: only the alerts sent change. It never changes another person's alerts (there is no way to name one). Anyone in the sub-account.
Parameter
Description
alerts
body · object
The alerts to change: any of new_lead, lead_reply, incoming_call, appointment_booked, appointment_reminder, missed_call, delivery_failure, team_mention, each true or false.
Returns a URL any website form, landing page tool or CRM can POST leads (or appointments) to.
Parameter
Description
name
body · string · required
e.g. Website contact form.
field_mapping
body · object
Their field name to ours: {"Full Name":"full_name","Roof size":"custom:roof_size"}. Targets: full_name, or first_name and last_name (saved together as the lead's name), email, phone, address, city, state, zip, inquiry, notes, appointment_*, utm_source, utm_medium, utm_campaign, utm_term (ad set), utm_content (ad) or custom:<field_key>. A state is saved as its code ("Texas" becomes TX); utm_source sets the Leads page Source filter ("meta_ads" or "facebook" is Facebook).
default_source
body · string
Source label stamped on these leads.
default_status
body · string
Default new.
payload_kind
body · string
Default auto. update = a form your own team fills in (e.g. during a call): its answers go onto the matching contact (lead_id, phone, then email; added quietly when nobody matches) and nothing is sent: no first text, team alert, Instant Lead Connect call or new-lead automation.
Pushes lead and appointment events to another system (Zapier, Make, a CRM). Lead data leaves the account, so every write needs an admin-scoped key and target_url must be https on a public host. The signing secret is returned once.
Parameter
Description
name
body · string · required
e.g. Zapier: new leads.
target_url
body · string · required
https:// URL that receives the POST.
events
body · array
Default lead.created and appointment.booked. See the sub-account webhook events list.
enabled
body · boolean
Default true.
preset
body · string
Payload flavour.
One of: zapier, make, salesforce_flow, service_titan, custom
auth_type
body · string
Default none. Send auth_token (and auth_header_name or auth_username) with it. Write-only.
Photos of the business's work the AI may text a customer who asks to see some (up to 100): link, caption, the service it shows, on / off, how often it was sent. Owners and admins.
From a public link to a JPEG, PNG or WebP (10 MB at most), stored like an upload on the page. The AI writes the caption and service you leave out, which is how it picks the right photo. 409 at 100 photos.
The services and products the AI may quote in texts, emails, chat and on calls (up to 300), each with price_text as the AI says it, plus note (what it says with prices) and currency. Owners and admins.
Parameter
Description
include_price_book
query · boolean
Also the invoice Price book items the AI isn't using (ai_enabled false).
One item, or items with up to 100. A name already in the Price book changes that item instead of adding a twin, and puts it on the AI's list. Prices are in cents. 409 past 300 items.
Parameter
Description
items
body · array
Several at once: each takes the fields below.
name
body · string
What it is (max 120).
kind
body · string
service (default) or product.
category
body · string
A group for it (max 60).
description
body · string
What's included, sizes, conditions (max 500).
price_type
body · string
fixed (default), from, range or quote (no set price).
unit_price_cents
body · number
The price, or the bottom of a range, in cents. Required unless quote.
AI Brain > Waiting on you: questions customers asked (texts, chat, DMs, calls) that the AI couldn't answer and handed to the team, newest first, one row per question (times = how many customers asked, variants = how they wrote it). Answered and dismissed ones are left out. Owners and admins.
As Answer it on the page: the answer becomes a saved answer (replacing one to the same question) that the AI texter and receptionist use from now on, the question leaves the list, and the AI turns back on for the leads it was paused on for that question. Nothing is sent to the customer.
Parameter
Description
question
body · string · required
The question as listed.
answer
body · string · required
What the AI should say (max 2000).
event_id
body · string
The row's event_id.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/ai-brain/waiting/answer" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"event_id": "uuid",
"question": "Do you work on Sundays?",
"answer": "No, we'\''re open Monday to Saturday, 8 to 6."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/ai-brain/waiting/answer", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
event_id: "uuid",
question: "Do you work on Sundays?",
answer: "No, we're open Monday to Saturday, 8 to 6.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/ai-brain/waiting/answer",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"event_id": "uuid",
"question": "Do you work on Sundays?",
"answer": "No, we're open Monday to Saturday, 8 to 6.",
},
)
print(res.json())
The AI that answers the sub-account's phone. Answered calls bill 1.5 credits per minute of AI conversation (15-second steps; time after a transfer to a person bills as phone minutes), and it needs a phone number on the sub-account to do anything (the response carries a warning when there is none).
Parameter
Description
enabled
body · boolean
Turn it on or off.
mode
body · string
Every call, or only outside business hours.
One of: always, after_hours
goal
body · string
What it tries to do.
One of: book, support, book_and_support
agent_name
body · string
Max 40.
voice
body · string
One of the voices returned by GET.
greeting
body · string
Max 400.
after_hours_greeting
body · string
Max 400.
extra_instructions
body · string
Max 1200.
transfer_enabled
body · boolean
Allow transfers to a person.
transfer_numbers
body · array
Up to 8 phone numbers.
take_messages
body · boolean
Take a message when nobody is available.
max_call_seconds
body · number
60-1800.
record_calls
body · boolean
Record answered calls (billed per recorded minute).
update_contact_details
body · boolean
Let it save the caller's name, email and address to the lead.
collect_fields
body · array
Details it asks for before booking: "full_name", "phone", "email", "address" or custom field keys (GET /v1/custom-fields). Max 12.
The sub-account's AI agents: named assistants that watch a connected email inbox, sort new mail and answer customers. Each has its settings, mailbox (provider gmail | outlook, account_email, status; null until an inbox is connected in the app), working (on, with a healthy inbox) and waiting_for_you (emails a person has to act on). Any member of the sub-account. While AI Agents is in its beta, accounts that are not on it get 404 on every AI agent route.
Makes an agent. Only name is required; it starts switched off, in approve mode (every reply waits as a draft). It answers email once an inbox is connected to it on its page in the app (a sign-in with Google or Microsoft, which the API can't do) and it is switched on. Up to 50 agents a sub-account. Owners and admins.
Parameter
Description
name
body · string · required
The agent's name, up to 60 characters.
role
body · string
Its job title (default Email assistant), up to 80 characters.
avatar_url
body · string
An https link to its picture.
instructions
body · string
How it should answer, up to 6,000 characters.
signature
body · string
The sign-off under its emails, up to 600 characters.
enabled
body · boolean
On or off (default off).
reply_mode
body · string
approve: every reply waits as a draft. auto: customer emails are answered straight away, anything unclear still waits.
One of: approve, auto
can_book
body · boolean
May it book appointments (default true).
daily_reply_cap
body · number
Most replies a day, 1-1000 (default 100).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/ai-agents" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"name": "Ava",
"role": "Email assistant",
"instructions": "Keep replies short and friendly. Always offer a time to come out.",
"signature": "Ava\nCastillo Roofing"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/ai-agents", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
name: "Ava",
role: "Email assistant",
instructions: "Keep replies short and friendly. Always offer a time to come out.",
signature: "Ava\nCastillo Roofing",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/ai-agents",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"name": "Ava",
"role": "Email assistant",
"instructions": "Keep replies short and friendly. Always offer a time to come out.",
"signature": "Ava\nCastillo Roofing",
},
)
print(res.json())
Changes only what is sent: name, role, avatar_url, instructions, signature, enabled, reply_mode (approve | auto), can_book, daily_reply_cap (1-1000). Switching reply_mode to auto lets it answer customer emails without anyone reading them first. Owners and admins.
The emails the agent looked at, newest first, and what it did with each: category (customer | owner | ignore), summary, urgent, status (new | working | replied | draft | needs_you | skipped | failed | dismissed), status_reason, needs_a_person, the drafted reply (draft), the reply that went out (reply) and the contact (lead_id). Emails made with try are left out unless include_tests=true. Any member of the sub-account.
Parameter
Description
agent_id
path · string · required
Agent id.
status
query · string
One or more statuses, comma-separated (draft,needs_you,failed = what waits for a person).
The agent page's Try it: the agent sorts a made-up email and drafts the reply it would write. Nothing is sent, nothing stays in the CRM and nothing is charged. Answers status and the email with its draft. Owners and admins.
Parameter
Description
agent_id
path · string · required
Agent id.
body
body · string · required
The email's text.
from_name
body · string
Who it is from.
from_email
body · string
Their address (default customer@example.com).
subject
body · string
Its subject.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/ai-agents/AGENT_ID/try" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"from_name": "Jenna Morales",
"subject": "Quote?",
"body": "Hi there, how much do you charge to come out and take a look? Do you have anything open this week?"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/ai-agents/AGENT_ID/try", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
from_name: "Jenna Morales",
subject: "Quote?",
body: "Hi there, how much do you charge to come out and take a look? Do you have anything open this week?",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/ai-agents/AGENT_ID/try",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"from_name": "Jenna Morales",
"subject": "Quote?",
"body": "Hi there, how much do you charge to come out and take a look? Do you have anything open this week?",
},
)
print(res.json())
Sends the drafted reply to the customer from the agent's connected inbox, or body when given (an edited reply). A draft that books an appointment, sent unchanged, books it. Refused for try emails, emails with no contact or no inbox, and with 409 when someone already answered the thread from the inbox itself (the email is then marked handled). An email already replied to answers replied and sends nothing. Owners and admins.
Runs a failed email again (only status failed). The agent sorts it and drafts a reply; in auto mode, with the agent on, it answers the customer straight away. Owners and admins.
Read the AI texting agent and automatic text settings
GET/v1/ai-texting
Read only
AI replies, agent name, reply mode, goal, what it knows, booking link, first text, send window, hand-off, confirmation and reminder texts, missed-call text-back, email greeting, and a preview of its prompt. Says whether the sub-account has a phone number.
Changes how the AI texts a sub-account's leads. Send only the settings to change. Every value is checked.
AI replies:
- ai_replies turns them on or off. Turning them on lets the AI answer conversations still waiting for a reply.
- agent_name, reply_mode (auto | suggest), goal (book_appointment | collect_details | customer_support), business_context, booking_link.
- max_replies (1-15), reply_delay_minutes (1-120), ai_can_cancel, ai_answers_email.
- handoff_when_unsure, pause_ai_on_handoff, handoff_resume_days (0, 1, 2, 3 or 7).
- prompt_addition adds one more rule; prompt rewrites the whole instructions.
The first text to a new lead:
- greet_new_leads, first_message, greet_delay_minutes, form_greet_delay_minutes.
- smart_first_text: the AI writes each new lead's first text from their answers and the right calendar's open times; first_message becomes the backup.
- smart_first_text_goal: what that text should get them to do. Empty means book an appointment.
- email_greeting, email_greeting_subject, email_greeting_body.
Missed calls, confirmations and reminders:
- missed_call_text, missed_call_message.
- confirmation_text, confirmation_message.
- confirmation_email (the confirmation email with a calendar invite, plus the move and cancel emails), confirmation_email_language (en | es).
- reminder_24h, reminder_24h_message, reminder_1h, reminder_1h_message.
- reminder_5m (off by default), reminder_5m_message.
When texts may go out:
- send_window (anytime | daily | booking_hours), send_window_start and send_window_end ("HH:MM").
Owners, agency admins and client admins.
Parameter
Description
ai_replies
body · boolean
The AI answers leads by text.
agent_name
body · string
First name the AI texts as (max 40).
reply_mode
body · string
suggest = drafts each reply for a teammate to approve (GET /v1/reply-suggestions).
One of: auto, suggest
first_message
body · string
First text to a new lead. Variables {first_name}, {agent}, {business}, {service}.
send_window
body · string
When automated texts may go out.
One of: anytime, daily, booking_hours
prompt_addition
body · string
A rule added to the end of the AI's prompt (max 2000).
Replaces one channel's steps and turns it on. Timing is the app's: the first 3 hours after the first text, then front-loaded days over span_days (about 5 days per message, at most 60), or the explicit days you send. At most 40 texts or 60 emails; email needs a verified sending domain. Pending sends that would change channel are cancelled.
Parameter
Description
channel
body · string
Default sms.
One of: sms, email
messages
body · array · required
One message per step, in order.
subjects
body · array
Email only: one subject per message.
span_days
body · number
Days from the first message to the last (1-365).
days
body · array
Instead of span_days: the day each message goes out, going up. 0 = 3 hours in.
enabled
body · boolean
Default true.
Request
cURL
curl -X PUT "https://api.localflywheel.com/v1/nurture-sequence" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"channel": "sms",
"messages": [
"Hi {first_name}, still looking for a quote?",
"Quick check-in from {business}: want me to hold a time for you?"
],
"span_days": 7
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/nurture-sequence", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
channel: "sms",
messages: [
"Hi {first_name}, still looking for a quote?",
"Quick check-in from {business}: want me to hold a time for you?",
],
span_days: 7,
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.put(
"https://api.localflywheel.com/v1/nurture-sequence",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"channel": "sms",
"messages": [
"Hi {first_name}, still looking for a quote?",
"Quick check-in from {business}: want me to hold a time for you?",
],
"span_days": 7,
},
)
print(res.json())
New leads, booked leads and appointments (each with the previous window of the same length for comparison), upcoming appointments, contacted, won and closed, speed to lead (median minutes to the first reply: anyone, AI or automation, a person), AI replies sent, calls (answered, missed, voicemails, AI calls, talk time), and stage_reach: of the leads created in the window, how many reached each pipeline stage (total, and reached keyed by stage key from GET /v1/stages; a lead counts for every stage it has been in, so a lead that sat and then won counts for both; the Overview's "<Stage> rate" cards divide reached by total). Moves made before 2026-10-16 are not known. stage_reach is null if it could not be read. Viewers limited to their own leads see only those.
Parameter
Description
days
query · number
1-365, default 30.
from
query · string
ISO start, instead of days (window at most 366 days).
The 0-100 health score from the Sub-accounts list and its breakdown: grade (Excellent, Healthy, Needs attention, At risk, Dormant), the five factors (activity recency 15, lead flow 20, speed to lead 25, leads answered 15, booking rate 25) with the points each earned, its value and how it was worked out; a factor that can't be measured yet has earned null (listed in not_measured) and its weight is spread over the rest. verdict says what goes well and what holds it back; actions is what would raise it, biggest gain first (gain in score points; path is the page inside the sub-account, e.g. settings?tab=messaging), with people waiting for a reply first. history is the score at the end of each of the last weeks (oldest first, the last one now), and last_30_days the funnel, reply speed and lead sources behind it. Leads leave out spam and imported lists. Any member; Technicians and Viewers limited to their own leads are scored on those.
Every sub-account the key's person can open, best first, scored as GET /v1/health-score scores them: score, grade, rank among the active ones (null for a sub-account where nothing has happened yet), the factor holding it back most (held_back_by, when it costs 3 points or more), each factor's points and the inputs; plus the median score and the medians of each input across the active ones. A key restricted to one sub-account gets just that one. Archived sub-accounts are left out unless include_archived=true.
What the sub-account spent in a window, by tool (the Usage tab's names: texts, lead alert texts, email, AI text replies, website chat widget, AI agents, phone calls, AI receptionist, AI calling, phone numbers, ad tools) and by day. unpaid counts events that ran while the account was out of credits.
Settings > Features > Sales (off until an owner or admin turns it on: 403 feature_off until then). Won jobs in the window by the date they were won, as the Sales page adds them up: what customers paid, parts, tips and profit in total, per technician (deal_sold_by, else whoever the lead is assigned to), per lead source and per tag, plus the jobs themselves. Every group also has plans, monthly_cents (the monthly revenue its new plans add) and expected_cents (what its jobs are expected to bring in, one-time jobs at their amount), and each job its deal_type and plan (Plans & memberships). Record a sale with PATCH /v1/leads/{lead_id}: status won, deal_value_cents, deal_parts_cents, deal_tip_cents, deal_sold_by. Owners and admins only.
Everything that happened in the sub-account, newest first, as Settings > Activity log shows it: every change (the fields that changed, before and after, secrets hidden) with who made it (a person, an API key, the AI or an automation), their IP and browser, who opened what (contacts, conversations, recordings, exports), and messages, calls, bookings, automation runs, notifications and errors. Keyset paged by next_cursor. summary=true adds the page's counts by type and by day and who did the most. Owners and admins only.
Every lead with a message either way (or an unread one), like the Inbox: unread count, archive state, whether the AI is paused on it (and the question it handed to the team), and the last message or call. The first page also returns the Inbox counts. Read the thread with GET /v1/leads/{lead_id}/conversation.
Parameter
Description
archived
query · boolean
true = the Archived tab. Default false.
unread
query · boolean
Only unread conversations.
assigned_to
query · string
A user id, "me" or "unassigned".
search
query · string
Name, email or phone contains (2-80 characters).
imessage_line_id
query · string
Only the conversations this iMessage Mac has had (GET /v1/imessage/lines), like the Inbox's number filter.
paused: true stops AI replies to this lead (and its automatic follow-ups at send time) until someone turns it back on, or until until. paused: false turns it back on and clears any hand-off. The sub-account-wide switch is ai_replies on PATCH /v1/ai-texting.
Parameter
Description
lead_id
path · string · required
Lead id.
paused
body · boolean · required
Pause (true) or resume (false).
until
body · string
ISO time the AI turns itself back on (paused: true only, at most a year away).
When AI texting's reply_mode is suggest, the AI drafts its reply to each text or email here instead of sending it. Each one shows the lead, the draft, and the appointment it would book or cancel. reply_mode in the response says whether the sub-account is in suggest mode.
Parameter
Description
status
query · string
Default pending.
One of: pending, sending, sent, dismissed, superseded, failed, all
Sends it to the lead as the AI (edited, if you send body), makes the booking or cancellation it decided on, and is charged exactly like an automatic AI reply plus the text, through the same code as the Inbox's Send button. Owners and admins only. 409 = someone already answered or the lead wrote again (nothing sent), 422 = not sent for a reason in error (e.g. AI paused, out of credits, that time is no longer open), 503 = a sending hiccup, try again.
Parameter
Description
suggestion_id
path · string · required
Suggestion id.
body
body · string
The edited reply to send instead (texts up to 1600 characters, emails 5000).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/reply-suggestions/SUGGESTION_ID/approve" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"body": "Thursday at 2pm works! See you then."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/reply-suggestions/SUGGESTION_ID/approve", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
body: "Thursday at 2pm works! See you then.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/reply-suggestions/SUGGESTION_ID/approve",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"body": "Thursday at 2pm works! See you then.",
},
)
print(res.json())
The Inbox composer's reply assistant: up to three ready replies in the business's tone (Settings > Reply assistant), written from the conversation, calls, appointments, the lead's stage and the AI Brain. kind says what they are: reply (an answer to their message), follow_up (a nudge after the business's own message) or first (the first message). Send draft to polish your own text instead (how: improve, grammar, shorter, a tone, or custom with instruction); the answer is text. Nothing is sent or saved: send the one you pick with POST /v1/messages. Free, and counted in the person's hourly allowance shared with the Inbox (429 when it's used up). Anyone who can see the lead.
Parameter
Description
lead_id
path · string · required
Lead id.
channel
body · string
Where the reply goes. Default sms.
One of: sms, email, chat, instagram, messenger
tone
body · string
New ideas only: this tone instead of the business's own.
One of: friendly, professional, casual, formal
avoid
body · array
New ideas only: up to 6 replies you already have, to get different ones.
draft
body · string
Polish this text instead (max 4000).
how
body · string
With draft. Default improve.
One of: improve, grammar, shorter, friendly, professional, casual, formal, custom
The CRM overview's "Needs you now": everyone from the last 14 days waiting on someone at the business, newest first, and why. ai_handoff: the AI told them the team would get back to them and nobody has written, called or booked them since (question is what it couldn't answer, asked_again when they chased it). missed_call: they called and nobody picked up or called back (voicemail, message_taken by the AI receptionist, call_note). message: their message has no reply from a person or the AI (reminders, follow-ups and automations aren't replies; a thanks or ok after a message that asked nothing needs none; with AI replies on, a brand-new message is the AI's for its first 3 minutes). total, by_reason and longest_since count everyone; leads lists up to limit. Technicians and limited Staff see only their own leads.
A sub-account's call recording and voicemail (Settings > Phone): whether calls are recorded (call_recording_enabled) and which kinds (call_recording_inbound, call_recording_outbound, call_recording_forwarded; recording_now lists the kinds being recorded right now), the announcement callers hear before the call connects, whether voicemail is on and which greeting plays (voicemail_greeting: default, typed or recording). notes says so when calls are recorded with no announcement. Anyone in the sub-account.
import os
import requests
res = requests.get(
"https://api.localflywheel.com/v1/call-settings?workspace_id=WORKSPACE_ID",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"call_settings": {
"workspace_id": "uuid",
"call_recording_enabled": true,
"call_recording_inbound": true,
"call_recording_outbound": true,
"call_recording_forwarded": false,
"call_recording_announcement": "This call may be recorded for quality and training purposes.",
"recording_now": [
"inbound",
"outbound"
],
"voicemail_enabled": true,
"voicemail_greeting": "typed",
"voicemail_greeting_text": "Hi, you've reached Castillo Roofing. Leave your name and number and we'll call you right back.",
"voicemail_greeting_url": null,
"notes": []
}
},
"error": null
}
Only what's sent changes; what GET answers can be sent straight back. Recording: the switch, the three kinds, and call_recording_announcement (spoken to the caller before the call connects; null for none). Many states require everyone on a call to agree to being recorded, so keep an announcement while recording is on: the answer's notes says so when there is none (the app recommends it and doesn't refuse either). Voicemail: voicemail_enabled, and voicemail_greeting_text (3-600 characters), which callers hear in a plain built-in voice and which replaces a recorded greeting; reset_voicemail_greeting: true goes back to the standard greeting. A greeting recorded, uploaded or spoken in a chosen voice is made in the app, and so is one number's own greeting (which wins over this one). People who manage the sub-account.
Parameter
Description
call_recording_enabled
body · boolean
Record calls.
call_recording_inbound
body · boolean
Calls people make to the business's numbers.
call_recording_outbound
body · boolean
Calls placed from the dialer.
call_recording_forwarded
body · boolean
Calls forwarded on to another phone.
call_recording_announcement
body · string
Spoken before the call connects, up to 500 characters; null for none.
voicemail_enabled
body · boolean
Missed callers can leave a message.
voicemail_greeting_text
body · string
What callers hear before the beep, 3-600 characters.
reset_voicemail_greeting
body · boolean
true: back to the standard greeting.
Request
cURL
curl -X PATCH "https://api.localflywheel.com/v1/call-settings" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"call_recording_enabled": true,
"call_recording_announcement": "This call may be recorded for quality and training purposes."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/call-settings", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
call_recording_enabled: true,
call_recording_announcement: "This call may be recorded for quality and training purposes.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.patch(
"https://api.localflywheel.com/v1/call-settings",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"call_recording_enabled": True,
"call_recording_announcement": "This call may be recorded for quality and training purposes.",
},
)
print(res.json())
Instant Lead Connect (Settings > Calls): when a new lead comes in, the business's phone rings its team one after another and whoever answers is connected to the lead. The settings as the app shows them; a sub-account that never saved any answers the defaults (off). call_order lists who rings: a teammate by user_id (never their phone), other phones whole only to people who may change the settings and as their last four digits to everyone else. Anyone in the sub-account.
Only what's sent changes, by the app's own limits. enabled: true makes the business's phone call its team for every new lead from the sources ticked, from then on (409 while the sub-account has no phone number); this route itself never starts a call. call_order replaces the list: { kind: "member", user_id } rings a teammate on the phone saved on their own profile (400 when they aren't on the team or have no phone there; a phone can't be typed for a teammate), { kind: "phone", phone, label } rings any other number; each may carry ring_seconds 10-60; up to 20. Ring times 10-60 seconds, trigger_delay_minutes 0-120, quiet hours as 24-hour times with a time zone and call_days (at least one), retry_ladder up to 6 waits of 1-720 minutes, whisper templates up to 1,000 characters. Auto greets (the recorded greeting a lead hears) are made in the app. Only the sub-account's owner and the owner's own team (the agency side) may change it, as in the app.
Parameter
Description
enabled
body · boolean
Call the team for new leads.
enabled_sources
body · array
Which leads: smart_form, meta_lead, api, webhook, website, manual.
call_order
body · array
Who rings, in order: [{ kind: "member", user_id, ring_seconds? } | { kind: "phone", phone, label?, ring_seconds? }].
assigned_rep_first
body · boolean
Ring the lead's assigned person first.
skip_busy_reps
body · boolean
Skip someone already on a call.
salesperson_ring_seconds
body · number
10-60.
lead_ring_seconds
body · number
10-60.
trigger_delay_minutes
body · number
Wait before calling, 0-120.
require_press_1
body · boolean
The teammate presses 1 to take the call.
auto_connect_on_answer
body · boolean
Connect as soon as the teammate answers.
record_calls
body · boolean
Record these calls.
transcribe_recordings
body · boolean
Write out the recordings.
sms_after_no_connect
body · boolean
Text the lead when nobody could be connected.
quiet_hours_enabled
body · boolean
Hold calls outside the hours below.
quiet_hours_start
body · string
When quiet hours start, like 18:00.
quiet_hours_end
body · string
When they end, like 08:00.
quiet_hours_timezone
body · string
IANA time zone.
call_days
body · array
Days calls may go out while quiet hours are on: sun..sat.
retry_ladder
body · object
{ enabled, delays_minutes: [5, 15, 60] }.
whisper_template
body · string
What the teammate hears first; {{first_name}}, {{full_name}}, {{business_name}}, {{lead_source}}, {{service}}...
whisper_include_form_answers
body · boolean
Read the lead's form answers out too.
call_on_booking
body · boolean
Also call when a lead books.
booking_whisper_template
body · string
The whisper for a booking; {{appointment_time}} too.
Its calls, newest first: the lead (lead_id, lead_name), where the lead came from, who was rung (recipient_label, never their phone), connection_status and final_outcome, whether each side answered and how long each rang, how long they talked, whether there is a recording (has_recording; the recording itself is played in the app), the transcript when there is one, and retry_attempt. Anyone in the sub-account.
Saves a new outbound AI calling campaign as a draft: nobody is enrolled and nothing is dialled. Starting or resuming a campaign places real, paid calls, so that is done in the app (Campaigns). Who it calls: audience_statuses (built-in stages: new, contacted, qualified, booked, partial; default new, contacted, partial), audience_stages (custom stage keys), audience_sources, audience_tag_ids, audience_created_within_days, audience_skip_booked (default true: leads with an appointment on the calendar are skipped); won, lost and spam leads, leads with no phone or a bad number, and leads who asked not to be called are never called. What the agent says: agent_name, goal, offer, greeting, script, extra_instructions, transfer_number, calendar_id; a field left out uses the sub-account's AI caller settings. When: call_days and call_window_start / call_window_end in the sub-account's time zone, run_days, start_at, max_attempts_per_lead, hours_between_attempts, daily_call_cap, max_concurrent_calls, stop_on_reply, spend_cap_credits. The calendar, tags and stages named must be the sub-account's own. Owners and admins of the sub-account.
Parameter
Description
name
body · string · required
The campaign's name, up to 120 characters.
audience_statuses
body · array
Built-in stages to call: new, contacted, qualified, booked, partial. Empty with no audience_stages = every open lead.
audience_stages
body · array
Custom stage keys to call (GET /v1/stages).
audience_sources
body · array
Only leads from these sources.
audience_tag_ids
body · array
Only leads with one of these tags: ids from GET /v1/tags.
audience_created_within_days
body · number
Only leads added in the last N days (1-3650), or null.
audience_skip_booked
body · boolean
Skip leads with an appointment on the calendar. Default true.
rolling
body · boolean
Keep adding new leads that match while it runs. Default true.
agent_name
body · string
The agent's name, up to 80 characters.
goal
body · string
What the call is for.
One of: book_appointment, qualify, confirm_interest
offer
body · string
What the call is about, up to 4000 characters.
greeting
body · string
The opening line, up to 2000 characters.
script
body · string
What to say and ask, in order, up to 8000 characters.
extra_instructions
body · string
Anything else the agent should know, up to 20,000 characters.
transfer_number
body · string
A person's number the agent can put the lead through to, with its country code (+14155550123). Not the line the campaign calls from. null = no transfers.
calendar_id
body · string
The calendar the agent books into (GET /v1/calendars).
max_call_seconds
body · number
Longest call, 60-900 seconds.
voicemail_action
body · string
On voicemail.
One of: hangup, leave_message
voicemail_message
body · string
What to leave, up to 2000 characters.
start_at
body · string
Earliest moment it may call once started (ISO date and time).
run_days
body · number
How many days it runs once started, 1-90 (default 30).
call_days
body · array
Days it may call: sun, mon, tue, wed, thu, fri, sat (default mon-fri).
The campaign whole: who it calls, what the agent says, when it calls, its progress (leads_total, calls_placed, calls_connected, bookings, credits_used) and audience_now: how many leads its rules match right now (who starting it would call). Owners and admins of the sub-account.
Changes only the fields sent (the fields of POST /v1/call-campaigns). Never its status: pausing is POST /v1/call-campaigns/{campaign_id}/pause, starting and resuming are done in the app. While the campaign is running, who it calls (the audience_ fields and rolling) can't change, because a running campaign calls whoever matches: 409, pause it first. Owners and admins of the sub-account.
Parameter
Description
campaign_id
path · string · required
Campaign id.
name
body · string
The campaign's name, up to 120 characters.
audience_statuses
body · array
Built-in stages to call: new, contacted, qualified, booked, partial. Empty with no audience_stages = every open lead.
audience_stages
body · array
Custom stage keys to call (GET /v1/stages).
audience_sources
body · array
Only leads from these sources.
audience_tag_ids
body · array
Only leads with one of these tags: ids from GET /v1/tags.
audience_created_within_days
body · number
Only leads added in the last N days (1-3650), or null.
audience_skip_booked
body · boolean
Skip leads with an appointment on the calendar. Default true.
rolling
body · boolean
Keep adding new leads that match while it runs. Default true.
agent_name
body · string
The agent's name, up to 80 characters.
goal
body · string
What the call is for.
One of: book_appointment, qualify, confirm_interest
offer
body · string
What the call is about, up to 4000 characters.
greeting
body · string
The opening line, up to 2000 characters.
script
body · string
What to say and ask, in order, up to 8000 characters.
extra_instructions
body · string
Anything else the agent should know, up to 20,000 characters.
transfer_number
body · string
A person's number the agent can put the lead through to, with its country code (+14155550123). Not the line the campaign calls from. null = no transfers.
calendar_id
body · string
The calendar the agent books into (GET /v1/calendars).
max_call_seconds
body · number
Longest call, 60-900 seconds.
voicemail_action
body · string
On voicemail.
One of: hangup, leave_message
voicemail_message
body · string
What to leave, up to 2000 characters.
start_at
body · string
Earliest moment it may call once started (ISO date and time).
run_days
body · number
How many days it runs once started, 1-90 (default 30).
call_days
body · array
Days it may call: sun, mon, tue, wed, thu, fri, sat (default mon-fri).
call_window_start
body · string
HH:MM (default 09:00).
call_window_end
body · string
HH:MM (default 18:00).
max_attempts_per_lead
body · number
1-12 (default 4).
hours_between_attempts
body · number
1-72 (default 4).
daily_call_cap
body · number
Calls a day, 1-1000 (default 100).
max_concurrent_calls
body · number
Calls at once, 1-5 (default 1).
stop_on_reply
body · boolean
Stop calling a lead who replies. Default true.
spend_cap_credits
body · number
Stop after this many credits, or null for no cap.
Request
cURL
curl -X PATCH "https://api.localflywheel.com/v1/call-campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"script": "Ask how the roof held up this winter, then offer the free inspection.",
"daily_call_cap": 60
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/call-campaigns/CAMPAIGN_ID", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
script: "Ask how the roof held up this winter, then offer the free inspection.",
daily_call_cap: 60,
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.patch(
"https://api.localflywheel.com/v1/call-campaigns/CAMPAIGN_ID",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"script": "Ask how the roof held up this winter, then offer the free inspection.",
"daily_call_cap": 60,
},
)
print(res.json())
Deletes the campaign. Calls still queued for it are dropped first, so a deleted campaign never dials. Calls already made stay in the call log. Owners and admins of the sub-account.
A count only, nobody is called: how many leads a set of audience rules would call right now (would_call), by the same rules a campaign enrols with, and who is held back: handed_to_a_person (the AI passed them to the team), asked_not_to_be_called, paused_by_the_team, bad_number, no_phone, has_an_appointment. by_stage splits would_call when more than one stage is picked. With no rules sent it counts every open lead with no appointment. Owners and admins of the sub-account.
The always-on AI caller of a sub-account (Settings > AI calling): whether it is on, whether it calls new leads by itself, what it says and when it calls. Shows the app's defaults until someone saves. The voice is picked in the app. Owners and admins of the sub-account.
Changes only the settings sent. With enabled and auto_enroll_new_leads both true, new leads that match eligible_sources and eligible_statuses (empty = all) are called by the AI caller by itself, first_call_delay_minutes after they come in, inside call_days and the call window; those calls cost credits like any AI call, so turn them on only when the business asked for it. default_calendar_id must be one of the sub-account's calendars. Owners and admins of the sub-account.
Parameter
Description
enabled
body · boolean
The AI caller on or off.
auto_enroll_new_leads
body · boolean
Call new leads by itself.
agent_name
body · string
Up to 80 characters.
goal
body · string
What a call is for.
One of: book_appointment, qualify, confirm_interest
greeting
body · string
The opening line, up to 2000 characters; null for the usual one.
offer
body · string
What the call is about, up to 4000 characters.
extra_instructions
body · string
Up to 20,000 characters.
call_days
body · array
sun, mon, tue, wed, thu, fri, sat.
call_window_start
body · string
HH:MM in the sub-account's time zone.
call_window_end
body · string
HH:MM.
first_call_delay_minutes
body · number
0-1440.
max_attempts_per_day
body · number
1-10.
hours_between_attempts
body · number
1-72.
max_total_attempts
body · number
1-20.
attempt_jitter_minutes
body · number
0-60: tries land a little before or after the hour.
Start or resume an AI calling campaign (places real calls)
POST/v1/call-campaigns/{campaign_id}/start
Read and writeIdempotent
PLACES REAL PHONE CALLS to real people and spends credits, so confirm: true is required; an assistant must tell the person which campaign and how many leads it would call (audience_now on GET /v1/call-campaigns/{campaign_id}) and get a clear yes first. Starts a draft, resumes a paused campaign, or runs a finished one again with a fresh run window: everyone who matches its audience now is put in line and called inside its calling hours. Refused (409) when the sub-account has no phone line that can place calls or the campaign is already running, (402) when it is out of credits. POST /v1/call-campaigns/{campaign_id}/pause stops it. Answers the campaign's status, run window and leads_total. Owners and admins.
Parameter
Description
campaign_id
path · string · required
Campaign id.
confirm
body · boolean · required
Must be true: real calls will be placed and credits spent.
The campaign's "Call them again". LEADS ARE CALLED when the campaign is running or start is true, so confirm: true is required and an assistant must get a clear yes from the person first. Puts leads back in line: new audience matches are added and finished leads with tries left are queued again. Leads who asked not to be called, said not interested, were paused by the team, have a bad number or are won, lost or booked are never queued (blocked); only a hand-off to a person is lifted (unpaused). Leads that already had every try stay finished (at_limit) unless fresh: true gives them the full number of tries again. The campaign's status only changes with start: true (a draft, a finished campaign or one paused by a person then starts, with the same checks as start). Owners and admins.
Parameter
Description
campaign_id
path · string · required
Campaign id.
confirm
body · boolean · required
Must be true: leads are put back in line to be called.
start
body · boolean
Also start the campaign so they are called. Default false.
fresh
body · boolean
Start from scratch: finished leads get the full number of tries again. Default false.
Every call on the sub-account's numbers: direction, type (softphone, bridge, inbound, forward, ai, ai_receptionist), status, duration, voicemail, the AI's outcome and summary, and the lead. Get one for its transcript and recording.
Parameter
Description
direction
query · string
Inbound or outbound.
One of: inbound, outbound
type
query · string
Call type.
One of: softphone, bridge, inbound, forward, ai, ai_receptionist
Settings → AI Brain: rules (instructions every AI reply follows), good examples (thumbs up) and lessons (thumbs down: what was wrong, a better reply, never send anything like it again). The AI texter and the voice agent read the active ones on every reply. Owners and admins only.
Like Add rule in Settings → AI Brain. channel limits it to texts (sms), email or calls (voice); leave it out for everywhere. To teach from a specific reply, rate it (POST /v1/messages/{message_id}/rating). Owners and admins only; at most 200 rules.
What can change depends on the kind, as in the app: a rule's note, channel and active; a thumbs-down lesson's note, better_reply, never_again and active; a good example's active only.
Exactly the Inbox's rating. up keeps the reply as a good example; down records what was wrong (reasons), what it should have said (better_reply), a note, and by default never to send anything close again; clear removes the rating. Rating the same message again replaces its lesson. Works on messages and calls sent to the lead (message ids from GET /v1/leads/{lead_id}/conversation). Owners and admins only.
Parameter
Description
message_id
path · string · required
The message (lead event) id.
rating
body · string · required
up, down or clear.
One of: up, down, clear
reasons
body · array
down only: wrong_info, too_pushy, too_long, missed_question, wrong_tone, should_not_reply.
better_reply
body · string
down only: what it should have said (max 2000).
note
body · string
down only: a note (max 600).
never_again
body · boolean
down only. Default true.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/messages/MESSAGE_ID/rating" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"rating": "down",
"reasons": [
"too_pushy"
],
"better_reply": "No rush at all, happy to answer any questions first."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/messages/MESSAGE_ID/rating", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
rating: "down",
reasons: ["too_pushy"],
better_reply: "No rush at all, happy to answer any questions first.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/messages/MESSAGE_ID/rating",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"rating": "down",
"reasons": ["too_pushy"],
"better_reply": "No rush at all, happy to answer any questions first.",
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"message_id": "uuid",
"rating": "down",
"lesson_id": "uuid",
"lesson": {
"id": "uuid",
"kind": "avoid",
"channel": "sms",
"ai_message": "Book now before slots fill up!",
"better_reply": "No rush at all, happy to answer any questions first.",
"reasons": [
"too_pushy"
],
"never_again": true,
"active": true
}
},
"error": null
}
Newest first. Filter by tags (tag_match=any returns leads with at least one of the tags, all leads with every one), status, pipeline stage, assignee, State, leads or existing customers (existing_customer; both by default), people who only chatted (chat_only; both by default), a name / email / phone search and a created-since time. Each lead carries existing_customer, chat_only (only messaged from website chat, Instagram or Messenger and shared no phone or email yet: a conversation in Messages, left off the Leads page and every lead count), inquiry (the CRM's Inquiry column), address, city, state, zip, custom_fields, tags and stage (the pipeline stage it shows in). Page with limit and offset: next_offset is set while there are more.
Parameter
Description
tags
query · string
Tag names, comma-separated (tags=VIP,Roof), or a JSON array (tags=["Roof, metal","VIP"]) when a name has a comma. Max 10.
tag_match
query · string
any (default): at least one of the tags. all: every tag.
One of: any, all. Default: any
status
query · string
One or more statuses, comma-separated: new, contacted, qualified, booked, won, lost, spam, partial.
stage_key
query · string
Pipeline stage key from GET /v1/stages.
assigned_to
query · string
A user id (GET /v1/members): leads assigned to them. "me": the key's own user. "unassigned": nobody's.
state
query · string
State / province / region as saved on the lead, comma-separated (state=TX,FL), like Leads > Filter > State. A name finds its code too ("Texas" finds TX). "none": leads with no State. Max 20.
existing_customer
query · boolean
true: only existing customers (the Leads page's Existing customers view). false: only leads. Leave out for both.
chat_only
query · boolean
false: leave out people who only messaged (website chat, Instagram, Messenger) and shared no phone or email yet, as the Leads page does. true: only them. Leave out for both.
search
query · string
The Leads page's search: every word (any order) must be somewhere in the lead: name, email, phone, campaign, ad, notes, address, answers or custom fields. A phone number matches however it's typed.
since
query · string
ISO timestamp: only leads created at or after it.
limit
query · number
Default 50, max 200.
offset
query · number
Skip this many leads; pass next_offset from the previous page.
The lead with every column, its raw_payload, the flattened inquiry, address, city, state, zip, custom_fields, tags and stage, plus its 50 most recent timeline events.
Needs workspace_id plus at least one of full_name, email or phone. Besides the lead's columns you can set inquiry, address, city, state, zip, custom_fields and tags. The lead and its tags are saved together, so automations that filter on tags see them; each tag fires the lead.tag_added automation trigger. A lead with the same phone (last 10 digits) or email already in the sub-account answers 409 with its lead_id and matched_on in details: update that lead instead. A field the API does not know answers 400 (it is never silently dropped). By default the intake doesn't run (no first text, follow-ups, team alert or Instant Lead Connect); run_intake: true works it like any new lead from a form and intake in the response says what ran. Either way it is a new lead to the rest of the CRM, as one added by hand is: automations that start on a new lead or a tag run, AI calling campaigns that take new leads pick it up, and the lead.created webhook fires. Not with existing_customer: true: a past customer is no new lead, so none of that runs, it stays out of the pipeline and the lead numbers, and run_intake is refused (400). Returns the lead as GET /v1/leads/{lead_id} shows it.
Parameter
Description
full_name
body · string
Lead name.
email
body · string
Email address.
phone
body · string
10-digit US number or + and a country code; stored as E.164.
phone_label
body · string
The main phone's label: Mobile, Home, Work, Other or your own words (40 characters).
extra_phones
body · array
The lead's other phone numbers, up to 10: numbers, or {phone, label} objects. Replaces the whole list; [] or null clears it. A text can go to any of them (POST /v1/messages to), and a text or call from one finds this lead.
Base lead status. To move a lead in the pipeline, send stage_key instead.
One of: new, contacted, qualified, booked, won, lost, spam, partial
stage_key
body · string
Pipeline stage key from GET /v1/stages. A stage also sets the status it stands for.
existing_customer
body · boolean
true = someone who was already a customer (a past customer list), not a lead, like Leads > Import "Existing customers": out of the pipeline and every lead count, and adding them starts no new-lead automations, AI calls or webhooks. A new one is won with no sale date (so no sale is counted) unless you send status or stage_key. false moves them back to leads. Changing it never moves the stage.
score
body · number
A number 0-100 that is yours to set, e.g. a counter your automations keep. Nothing writes it for you (AI lead scoring is off).
notes
body · string
Internal notes.
assigned_to
body · string
User id of someone in the sub-account (GET /v1/members). The agency owner only with the owner's own key (the app never offers them to the sub-account's people; a lead already on them may stay). null unassigns. A change is logged on the lead's timeline (Lead assigned / Lead unassigned), as in the app.
ad_name
body · string
Ad the lead came from.
campaign_name
body · string
Campaign the lead came from.
utm_source
body · string
UTM source.
utm_medium
body · string
UTM medium.
utm_campaign
body · string
UTM campaign.
utm_term
body · string
UTM term.
utm_content
body · string
UTM content.
landing_url
body · string
Page the lead converted on.
referrer_url
body · string
Referring page.
attribution_channel
body · string
e.g. meta, google, organic, direct.
gclid
body · string
Google Ads click id. A lead with one is sent back to the sub-account's Google Ads by its click when it books or is won (CRM conversions).
gbraid
body · string
Google Ads app-to-web click id.
wbraid
body · string
Google Ads web-to-app click id.
fbclid
body · string
Facebook click id.
msclkid
body · string
Microsoft Ads click id.
deal_value_cents
body · number
Deal value in cents: on a won job, what the customer paid (the Sales report's Sold, and the revenue sent to Meta).
deal_currency
body · string
3-letter currency code. Default USD.
deal_parts_cents
body · number
Won job: what the parts cost, in cents (Sales report).
deal_tip_cents
body · number
Won job: the tip the technician got, in cents.
deal_sold_by
body · string
Won job: the user id of the technician credited with the sale (GET /v1/members). null = whoever the lead is assigned to.
deal_won_at
body · string
When the job was won (ISO 8601). Set for you when status becomes won; send it to date a sale yourself.
deal_type
body · string
Plans & memberships: what the customer bought, one_time (a job) or plan (a plan or membership that pays again). null = one-time. A deal_plan_cents sent alone makes it a plan; one_time clears the plan.
One of: one_time, plan
deal_plan_cents
body · number
Plan: its price in cents, charged every deal_plan_interval. deal_value_cents is the first payment (the plan price when you leave it out).
deal_plan_interval
body · string
Plan: how often it's charged. Default month.
One of: month, quarter, year
deal_plan_start_date
body · string
Plan: when it starts (YYYY-MM-DD). Default today.
deal_plan_months
body · number
Plan: how many months it runs (1-600). null = no end date: the business's default length counts (12 months unless changed in Settings > Features). Leads return deal_monthly_cents and deal_expected_total_cents (first payment + the plan price for the rest of its length).
inquiry
body · string
What the lead asked about: the Inquiry column in the CRM (max 500). Without it the CRM shows the form or ad offer, then General inquiry.
address
body · string
Street address.
city
body · string
City.
state
body · string
State or region. A US state, Canadian province or Australian state is stored as its code ("Texas" -> "TX"), a Mexican state by name, like every other intake; the list follows the lead's country (its phone number, else the sub-account's country). Anything else is kept as sent.
zip
body · string
ZIP or postal code.
custom_fields
body · object
Custom field values keyed by field_key (GET /v1/custom-fields); a field's label also works. Values are checked against the field type: number/money/rating numbers, boolean true/false, date YYYY-MM-DD, datetime ISO 8601, select one of its options, multiselect a list of options. null or "" clears a value; fields you leave out keep their value.
tags
body · array
Tag names. New names are created in the sub-account (matched ignoring case). Max 50.
run_intake
body · boolean
Default false. true = work the lead like a new lead from a form: the first text (when Auto-greet is on; it waits while someone is on a call with the lead), follow-ups, team alert, Instant Lead Connect.
Send only what changes; null or "" clears a value. custom_fields merges: values you leave out are kept. tags REPLACES all of the lead's tags; add_tags and remove_tags change only those (applied in that order: tags, add_tags, remove_tags). A body with only tag changes is fine. stage_key moves the lead in the pipeline and sets the status that stage stands for. A field the API does not know answers 400. Returns the updated lead.
Parameter
Description
lead_id
path · string · required
Lead id.
full_name
body · string
Lead name.
email
body · string
Email address.
phone
body · string
10-digit US number or + and a country code; stored as E.164.
phone_label
body · string
The main phone's label: Mobile, Home, Work, Other or your own words (40 characters).
extra_phones
body · array
The lead's other phone numbers, up to 10: numbers, or {phone, label} objects. Replaces the whole list; [] or null clears it. A text can go to any of them (POST /v1/messages to), and a text or call from one finds this lead.
Base lead status. To move a lead in the pipeline, send stage_key instead.
One of: new, contacted, qualified, booked, won, lost, spam, partial
stage_key
body · string
Pipeline stage key from GET /v1/stages. A stage also sets the status it stands for.
existing_customer
body · boolean
true = someone who was already a customer (a past customer list), not a lead, like Leads > Import "Existing customers": out of the pipeline and every lead count, and adding them starts no new-lead automations, AI calls or webhooks. A new one is won with no sale date (so no sale is counted) unless you send status or stage_key. false moves them back to leads. Changing it never moves the stage.
score
body · number
A number 0-100 that is yours to set, e.g. a counter your automations keep. Nothing writes it for you (AI lead scoring is off).
notes
body · string
Internal notes.
assigned_to
body · string
User id of someone in the sub-account (GET /v1/members). The agency owner only with the owner's own key (the app never offers them to the sub-account's people; a lead already on them may stay). null unassigns. A change is logged on the lead's timeline (Lead assigned / Lead unassigned), as in the app.
ad_name
body · string
Ad the lead came from.
campaign_name
body · string
Campaign the lead came from.
utm_source
body · string
UTM source.
utm_medium
body · string
UTM medium.
utm_campaign
body · string
UTM campaign.
utm_term
body · string
UTM term.
utm_content
body · string
UTM content.
landing_url
body · string
Page the lead converted on.
referrer_url
body · string
Referring page.
attribution_channel
body · string
e.g. meta, google, organic, direct.
gclid
body · string
Google Ads click id. A lead with one is sent back to the sub-account's Google Ads by its click when it books or is won (CRM conversions).
gbraid
body · string
Google Ads app-to-web click id.
wbraid
body · string
Google Ads web-to-app click id.
fbclid
body · string
Facebook click id.
msclkid
body · string
Microsoft Ads click id.
deal_value_cents
body · number
Deal value in cents: on a won job, what the customer paid (the Sales report's Sold, and the revenue sent to Meta).
deal_currency
body · string
3-letter currency code. Default USD.
deal_parts_cents
body · number
Won job: what the parts cost, in cents (Sales report).
deal_tip_cents
body · number
Won job: the tip the technician got, in cents.
deal_sold_by
body · string
Won job: the user id of the technician credited with the sale (GET /v1/members). null = whoever the lead is assigned to.
deal_won_at
body · string
When the job was won (ISO 8601). Set for you when status becomes won; send it to date a sale yourself.
deal_type
body · string
Plans & memberships: what the customer bought, one_time (a job) or plan (a plan or membership that pays again). null = one-time. A deal_plan_cents sent alone makes it a plan; one_time clears the plan.
One of: one_time, plan
deal_plan_cents
body · number
Plan: its price in cents, charged every deal_plan_interval. deal_value_cents is the first payment (the plan price when you leave it out).
deal_plan_interval
body · string
Plan: how often it's charged. Default month.
One of: month, quarter, year
deal_plan_start_date
body · string
Plan: when it starts (YYYY-MM-DD). Default today.
deal_plan_months
body · number
Plan: how many months it runs (1-600). null = no end date: the business's default length counts (12 months unless changed in Settings > Features). Leads return deal_monthly_cents and deal_expected_total_cents (first payment + the plan price for the rest of its length).
inquiry
body · string
What the lead asked about: the Inquiry column in the CRM (max 500). Without it the CRM shows the form or ad offer, then General inquiry.
address
body · string
Street address.
city
body · string
City.
state
body · string
State or region. A US state, Canadian province or Australian state is stored as its code ("Texas" -> "TX"), a Mexican state by name, like every other intake; the list follows the lead's country (its phone number, else the sub-account's country). Anything else is kept as sent.
zip
body · string
ZIP or postal code.
custom_fields
body · object
Custom field values keyed by field_key (GET /v1/custom-fields); a field's label also works. Values are checked against the field type: number/money/rating numbers, boolean true/false, date YYYY-MM-DD, datetime ISO 8601, select one of its options, multiselect a list of options. null or "" clears a value; fields you leave out keep their value.
tags
body · array
REPLACES all of the lead's tags ([] removes them all). To change only some, use add_tags / remove_tags.
add_tags
body · array
Tag names to add; the lead's other tags stay. New names are created.
With delete_appointments=true its appointments go first, each the way the calendar deletes one: the synced Google / Outlook event, the customer's invite (cancelled if it was still on), its reminder texts, then the appointment; if one can't be deleted the lead is kept and the answer says how many went. Without it the appointments stay on the calendar with no lead, as before.
Parameter
Description
lead_id
path · string · required
Lead id.
delete_appointments
query · boolean
Also delete the lead's appointments (the app's "Also delete their appointments").
mentions tags teammates like @Name in the app's note box: each one on the sub-account's team who can see the lead gets an email and a push with the note and a link to the conversation (replies go to you); the answer lists who was told and who was skipped and why (not_on_team, cant_see_lead).
Parameter
Description
lead_id
path · string · required
Lead id.
body
body · string · required
Note text.
actor_label
body · string
Who the note is from.
mentions
body · array
Up to 20 user ids to tag (GET /v1/members).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/leads/LEAD_ID/notes" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"body": "@Sam can you call her back after 5?",
"mentions": [
"uuid"
]
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/leads/LEAD_ID/notes", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
body: "@Sam can you call her back after 5?",
mentions: ["uuid"],
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/leads/LEAD_ID/notes",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"body": "@Sam can you call her back after 5?",
"mentions": ["uuid"],
},
)
print(res.json())
Response 201
JSON
{
"success": true,
"data": {
"event": {
"id": "uuid",
"event_type": "note",
"body": "@Sam can you call her back after 5?"
},
"mentions": {
"tagged": [
{
"user_id": "uuid",
"name": "Sam Tech"
}
],
"skipped": []
}
},
"error": null
}
Every tag in the sub-account and how many leads carry it. A tag is created automatically the first time you send its name in a lead's tags or add_tags.
Settings > Tags. A new name (60 characters, no commas, not another tag's name: merge them instead) and/or a color. A rename also rewrites every automation that names the tag (Add / Remove tag steps, the Tag added trigger, tag conditions) unless update_automations is false. Owners and admins.
Folds tags into the one you keep: their contacts get the kept tag and the others are deleted. Moving a tag is not adding it, so no "Tag added" automation starts. Automations that name a folded-in tag are rewritten to the kept one unless update_automations is false. Name tags by name or id. Owners and admins.
A tag on its own, before any lead carries it. Names match in any case: a name that already exists answers that tag with created false (200) and changes nothing, so the call is safe to repeat. Up to 60 characters, no commas. Any member, as when tagging a lead in the app.
Adds a list of leads the way the Leads page's Import does: nothing is sent and nothing starts. No first text, no new-lead or tag automations, no AI calls, no team alerts, no lead.created webhook, no push to job software; "Leads imported" automations are not started from the API either. Each lead takes the fields of POST /v1/leads (full_name, email, phone, extra_phones, notes, address, city, state, zip, custom_fields, tags, status, stage_key, assigned_to, existing_customer, deal fields...) except source (always import) and run_intake; a lead needs a name, an email or a phone. tags go on every lead on top of its own (new tags are made; names are cut at 40 characters). existing_customers true adds them as existing customers: won with no sale date, out of the pipeline and every lead count. A lead imported as won gets no sale date unless deal_won_at is sent. Duplicates: a row whose email or phone (last 10 digits, main number or one of a lead's other numbers) is already in the sub-account, or earlier in the same call, is skipped and listed with the lead it matched; on_duplicate create imports it anyway where the sub-account allows a second record. Rows that can't be used are listed in refused with their index and why; the rest still go in. Send more than 500 in several calls. 201 when at least one lead went in, else 200. Owners and admins of the sub-account.
Parameter
Description
leads
body · array · required
1-500 leads, each an object with the fields of POST /v1/leads.
tags
body · array
Tag names for every lead in this call.
existing_customers
body · boolean
Add them as existing customers, not leads (a lead's own existing_customer wins). Default false.
on_duplicate
body · string
skip (default) or create.
One of: skip, create
file_name
body · string
Where the list came from (kept on each lead), up to 200 characters.
The Leads page's bulk bar: one action on every lead in lead_ids. add_tags / remove_tags (tags by name; new ones are made; a lead holds 50 at most), set_stage (stage_key from GET /v1/stages; a lead that becomes won gets today's sale date unless it has one), assign (assigned_to: a member's user id from GET /v1/members, or null to unassign; goes on each lead's timeline; the agency owner can't be picked by someone else), set_existing_customer (existing_customer true | false; only the flag, the stage stays). Each lead is written exactly like PATCH /v1/leads/{lead_id} with that one field, so automations and webhooks that start on a tag, a stage or a status change run for each lead as usual. Every id must be a lead of this sub-account: any other id is refused as "Lead not found" and never touched. The answer says how many changed and lists the refused ids with why. No messages are sent by this route. Owners and admins of the sub-account.
Parameter
Description
lead_ids
body · array · required
1-500 lead ids.
action
body · string · required
What to do to each of them.
One of: add_tags, remove_tags, set_stage, assign, set_existing_customer
Deletes every lead in lead_ids, each the way DELETE /v1/leads/{lead_id} does. It can't be undone, so confirm: true is required. With delete_appointments true each lead's appointments are deleted first the way the calendar deletes one (the synced calendar event, the customer's cancellation notice, the reminders); without it they stay on the calendar with no lead. Every id must be a lead of this sub-account: any other id is refused as "Lead not found". The answer says how many were deleted and lists the refused ids. Needs an admin key, like deleting one lead. Owners and admins of the sub-account.
Parameter
Description
lead_ids
body · array · required
1-500 lead ids.
confirm
body · boolean · required
Must be true.
delete_appointments
body · boolean
Also delete the leads' appointments (tells each customer theirs is cancelled). Default false.
For each tool the sub-account connected: connection_id, provider, name, external_id (the tool's own id for the lead, null when it doesn't have it), synced_at, url (a link to open it there, where the tool's address is known), last_error and auto_push. Anyone who can open the lead (a technician only their own).
The lead panel's Push to CRM: sends the lead to one connected tool even when it doesn't get new leads by itself. A tool that already has the lead keeps its record and no second one is made (already_there true). pushed false carries the tool's own error. Anyone who can open the lead.
Parameter
Description
lead_id
path · string · required
The lead.
connection_id
body · string · required
The tool (connection_id from GET /v1/leads/{lead_id}/crm or id from GET /v1/crm-connections).
The Leads page's Merge: the leads in merge_ids are merged into keep_id and then deleted for good, so confirm: true is required. Blank fields on the kept lead (full_name, email, phone, notes, source, utm_source, utm_medium, utm_campaign, assigned_to, gclid, gbraid, wbraid) are filled from the merged leads, oldest first; a field the kept lead already has is never changed, and a merged lead's own phone or email is not kept as a second one (add it to the kept lead's extra_phones yourself if it matters). The merged leads' tags go onto the kept lead, and their timeline (notes, texts, emails, calls), appointments, estimates, invoices, deals in extra pipelines, form submissions, website visits and queued follow-ups are re-pointed at it. Nothing is sent to anyone and no stage changes. It all happens together or not at all. The answer lists the fields filled (filled; fill_refused true when the fill could not be saved, which happens when a merged lead's phone would have been copied: check the kept lead then), how many rows moved per kind (moved) and any kind that could not be moved (not_moved). Every id must be a lead of this sub-account: any other id answers 404 with the ids in details.not_found and nothing is touched. Up to 20 leads merged in a call. Needs an admin key, like deleting leads. Owners and admins of the sub-account.
Parameter
Description
keep_id
body · string · required
The lead to keep.
merge_ids
body · array · required
1-20 lead ids to merge into keep_id. They are deleted.
Send an SMS, email, Instagram or Messenger message
POST/v1/messages
Read and writeIdempotent
Sends from the sub-account's own number / verified sending domain and logs the message on the lead timeline. Email requires a subject. Address the message with lead_id, or with a raw to (E.164 phone for SMS, email address for email) plus workspace_id — Local Flywheel matches an existing contact or creates one. Every send counts against the daily unique-contact safety limit (300 contacts per UTC day by default); replies to contacts already messaged today are free of the cap. Over the cap the call answers 429. Each message is billed at the platform rate and counts against the key's monthly credit budget, if it has one (402 when the budget is used up); a text through one of the sub-account's iMessage Macs is free. A text or email (and an email's subject) can use the lead's variables, as in the Inbox and automations: {first_name}, {full_name}, {business_name} and the rest listed by GET /v1/workspace-automations/reference are filled in for the lead before it goes. The message is sent as the key's user, as from the Inbox: the conversation names them, the Activity Log records them, the numbers and Macs they may text from apply, and an archived conversation comes back to the Inbox.
With send_at the message is scheduled instead, exactly like the Inbox's "Schedule message": the call answers 201 with the scheduled message, and at that time it is sent from the lead's usual number or sender as the key's user, with the same opt-out, credit and limit checks as a send now (a refusal then marks it failed with the reason). A contact who opted out, or has no phone or email for the channel, is refused up front (400). A scheduled message counts against the key's credit budget when it is scheduled. See, change, cancel or send it early with /v1/scheduled-messages.
With channel instagram or messenger the message is a reply in the Instagram or Messenger conversation the lead started with the business (lead_id only), exactly like replying from the Inbox: text only (Instagram up to 1,000 characters, Messenger 2,000), sent now, through the connected account the lead wrote to last, as the key's user. Instagram and Messenger only allow it within 24 hours of the person's last message there: after that the call answers 409 window_closed with reply_window_ends_at; also 409 when the lead never messaged there (no_social_contact) or the account is switched off or needs connecting again (channel_disabled, needs_reconnect), and 403 not_enabled when Instagram & Messenger is off for the account. It is free, uses none of the credit budget (still refused once the budget is used up) and isn't counted in the daily contact limit. The answer carries message_id and account_id (GET /v1/social/accounts).
Parameter
Description
lead_id
body · string
Lead to message. Required for instagram and messenger.
to
body · string
Without lead_id: raw destination (E.164 phone for sms, email address for email; requires workspace_id). With lead_id, sms only: which of the lead's numbers to text (phone or one of extra_phones); leave out for the main number.
channel
body · string · required
sms, email, instagram or messenger.
One of: sms, email, instagram, messenger
body
body · string · required
Message text.
subject
body · string
Required for email.
name
body · string
Contact name used when to creates a new lead.
media_urls
body · array
Up to 10 MMS/attachment URLs.
actor_label
body · string
Sender label shown in the timeline.
send_at
body · string
Schedule instead of sending now: ISO 8601 with a time zone (Z or an offset), e.g. 2026-10-20T09:00:00-05:00. In the future and at most 365 days ahead. Answers 201 with scheduled_message.
send_as
body · string
Texts, with an iMessage Mac connected (Beta): imessage sends a blue iMessage from one of the sub-account's iPhone numbers, sms from its business number, auto (default) lets the routing choose. The answer's transport says how it went (imessage, or mac_sms for the iPhone's own SMS).
One of: auto, imessage, sms
imessage_line_id
body · string
Texts: which Mac (iPhone number) sends it (GET /v1/imessage/lines).
audio_message
body · boolean
Texts: the one media_urls file is a voice message. Through a Mac running Advanced mode it arrives as a real iMessage audio message; anywhere else as an audio attachment. Not with send_at.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/messages" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"lead_id": "uuid",
"channel": "sms",
"body": "Hi Jane, are you still looking for a quote?"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
lead_id: "uuid",
channel: "sms",
body: "Hi Jane, are you still looking for a quote?",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/messages",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"lead_id": "uuid",
"channel": "sms",
"body": "Hi Jane, are you still looking for a quote?",
},
)
print(res.json())
Messages waiting to be sent later, scheduled in the Inbox or with POST /v1/messages and send_at. By default the upcoming ones (pending, sending, failed), soonest first, like the dashed bubbles at the end of a conversation; status = sent, cancelled or all lists history, newest first. A failed message carries last_error. Viewers limited to their own leads only see those leads' messages.
Parameter
Description
lead_id
query · string
Only this lead's messages.
status
query · string
Default upcoming (pending, sending, failed).
One of: upcoming, pending, sending, failed, sent, cancelled, all
Like the Inbox's Edit, Cancel and Undo. Send any of body, subject (emails), scheduled_at and media_urls (texts) to change a pending or failed message: it goes back in the queue (status pending). status: "cancelled" (on its own) stops it; status: "pending" brings a cancelled one back (send a new scheduled_at when its time has passed). 409 when it is sending or already sent. Owners and admins only.
Parameter
Description
scheduled_message_id
path · string · required
Scheduled message id.
body
body · string
The new text.
subject
body · string
The new subject (emails only).
scheduled_at
body · string
ISO 8601 with a time zone, in the future and at most 365 days ahead.
media_urls
body · array
Picture URLs for a text, max 10 (replaces the list).
status
body · string
cancelled to cancel, pending to restore.
One of: pending, cancelled
Request
cURL
curl -X PATCH "https://api.localflywheel.com/v1/scheduled-messages/SCHEDULED_MESSAGE_ID" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"scheduled_at": "2026-10-21T09:00:00-05:00",
"body": "Hi Jane, following up on your quote. Any questions?"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/scheduled-messages/SCHEDULED_MESSAGE_ID", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
scheduled_at: "2026-10-21T09:00:00-05:00",
body: "Hi Jane, following up on your quote. Any questions?",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.patch(
"https://api.localflywheel.com/v1/scheduled-messages/SCHEDULED_MESSAGE_ID",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"scheduled_at": "2026-10-21T09:00:00-05:00",
"body": "Hi Jane, following up on your quote. Any questions?",
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"scheduled_message": {
"id": "uuid",
"channel": "sms",
"body": "Hi Jane, following up on your quote. Any questions?",
"scheduled_at": "2026-10-21T14:00:00+00:00",
"status": "pending"
},
"changed": true
},
"error": null
}
The Inbox's "Send now": a pending or failed message goes out at once, as the teammate who scheduled it, with the usual opt-out, credit and limit checks, and is billed like any text or email. 200 = sent; 202 = a sending hiccup, it tries again by itself in a couple of minutes; 400 = refused, with the reason (the message is marked failed); 409 = cancelled, already sending or sent. Refused when the key's credit budget is used up. Owners and admins only.
Every SMS and email on the sub-account's Local Flywheel numbers and inboxes, and every Instagram and Messenger DM, newest first. A DM has channel instagram or messenger, no from / to / subject, its pictures and files in media_urls and social { account_id: the connected account (GET /v1/social/accounts), sent_by: user, ai, automation or page (sent from the Instagram or Facebook apps) on the business's side }. For polling, pass cursor (or since) — results then come oldest-first and next_cursor walks forward with no duplicates and no missed messages. Poll no more than once every 10 seconds, or subscribe to the message.received webhook instead. A text that went through one of the sub-account's iMessage Macs carries transport (imessage, or mac_sms for the iPhone's own green text) and imessage { line_id, from, service: imessage | sms | rcs, delivered_at, read_at }; a tapback carries reaction { by: them | you, type, emoji, reacts_to: the message it hangs on, removed }.
Parameter
Description
lead_id
query · string
Only messages with this contact.
channel
query · string
sms, email, instagram or messenger.
One of: sms, email, instagram, messenger
direction
query · string
inbound or outbound.
One of: inbound, outbound
since
query · string
ISO-8601 timestamp; returns messages created after it, oldest-first.
Returns the daily unique-contact cap (default 300 per UTC day), how many contacts have been used, what's left, segment usage and the reset time. The same values ride on every messaging call as X-Contacts-Limit / -Used / -Remaining / -Reset headers.
Every Mac connected to the sub-account for iMessage, the default first: its iPhone number, whose Mac it is, whether it's online, what the Mac reports about itself (health: Messages signed in, Full Disk Access, awake, lid closed allowed, iCloud still syncing, the number missing from or switched off in Messages), whether Advanced mode runs on it (advanced_mode: real audio messages and reactions), its settings (scope, create_leads, new_conversations, fallback, offline_minutes, ai_replies), who can text from it (access, allowed_user_ids, and can_use for you), its limits (new conversations a day and an hour, tries and length before someone first replies) and today's usage (new conversations today and this hour, messages waiting, every text it sent today, and how many other accounts share that iPhone's limit). has_number says whether the sub-account has a business number to fall back on; without one every text goes through a Mac. Any member. Connecting and disconnecting a Mac happen in the app.
Send only what changes. The sub-account's owners and admins change any Mac; everyone else only their own; only owners and admins choose the default (is_default: true moves it from the old one). access: everyone, owner (only the person whose Mac it is) or selected (allowed_user_ids); owners, admins and the Mac's owner can always text from it, and AI replies and automations aren't limited.
Parameter
Description
line_id
path · string · required
The Mac (GET /v1/imessage/lines).
label
body · string
A name for it (max 80), or null.
is_default
body · boolean
true makes it the default Mac.
access
body · string
Who can text from it by hand.
One of: everyone, owner, selected
allowed_user_ids
body · array
With access selected: the team members who can.
scope
body · string
crm: only conversations with people already in the CRM sync; all: every one-to-one conversation.
One of: crm, all
create_leads
body · boolean
With scope all: someone new who texts in becomes a lead.
new_conversations
body · string
How a first text to someone goes.
One of: sms, imessage
fallback
body · string
When they aren't on iMessage or the Mac is offline: the business number, RCS or SMS from the iPhone through the Mac, the iPhone and then the business number (mac_then_number, the default), or nothing.
One of: number, mac, mac_then_number, none
offline_minutes
body · number
How long a message waits for an offline Mac before the fallback, 2-240.
Puts a tapback (❤️ 👍 👎 😂 ‼️ ❓) on a text that went through one of the sub-account's Macs, like the Inbox's reaction picker; remove: true takes yours back. Only a Mac running Advanced mode can (advanced_mode on GET /v1/imessage/lines): otherwise 409 advanced_off. The reaction is queued (202) and shows on the message (its reaction, by you) once the Mac has sent it; if it can't, a note says why on the conversation. Anyone who can see the lead and text from that number. Free, like every text through a Mac.
Parameter
Description
message_id
path · string · required
The text to react to (an id from GET /v1/messages or the lead's conversation).
reaction
body · string · required
love, like, dislike, laugh, emphasize or question (or the emoji).
One of: love, like, dislike, laugh, emphasize, question
Settings > Phone's "Automated texts send from" (also on the Automations page): the way the texts the sub-account sends on its own go once it has a Mac connected. Automations, appointment confirmations and reminders, follow-ups and first texts follow it; an AI reply to a customer's own text still answers the way they wrote, and a step or send that names its own way keeps it. automatic lets each iPhone's iMessage settings decide, number sends from the business number, a line_id from that iPhone. GET /v1/imessage/lines returns the current choice as automated_texts_send_from. Owners and admins.
Parameter
Description
send_from
body · string · required
automatic, number, or the line_id of a connected iPhone (GET /v1/imessage/lines).
List the connected Instagram and Messenger accounts
GET/v1/social/accounts
Read only
The Instagram accounts and Facebook Pages (Messenger) connected in Settings > Instagram & Messenger: whether its DMs come into the Inbox (enabled; comment rules run either way), whether the AI answers its DMs (ai_replies), its connection (status connected, needs_reconnect or error, with last_error) and live: replies can go out through it. Any member. Connecting and switching accounts happen in the app. 403 not_enabled when Instagram & Messenger is off for the account.
Instagram and Facebook comments the comment-to-DM rules saw
GET/v1/social/comments
Read only
Recent comments in Settings > Instagram & Messenger: every comment a comment-to-DM rule matched, newest first, with the post, who wrote it, the rule, whether a public reply went under it, what happened to the DM (dm_status sent, failed with error, or skipped: that person already got it) and the lead it started a conversation with. counts has the number per result with every other filter applied; page with offset (next_offset). To answer someone, reply in their conversation with POST /v1/messages (channel instagram or messenger). Owners and admins.
Parameter
Description
status
query · string
What happened to the DM.
One of: sent, failed, skipped
account_id
query · string
One connected account (GET /v1/social/accounts).
rule_id
query · string
One comment-to-DM rule.
post_id
query · string
One post or reel.
commenter_id
query · string
Everything from one person (commenter.id).
search
query · string
Commenter name or comment text contains (max 100).
Settings > Instagram & Messenger > Who goes into Leads. lead_mode qualified (the default): someone who only sent a DM is a conversation in Messages, not a lead, until they share a phone number or email, book, or someone adds them to Leads (leads carry chat_only meanwhile and every lead count leaves them out). everyone: every new DM person is a lead right away. dm_leads_to_move (owners and admins; null for others): how many Instagram and Messenger people from before are still in Leads as New with no phone, email, booking or deal (POST /v1/social/move-dm-leads moves them). Any member reads the mode. 403 not_enabled when Instagram & Messenger is off for the account.
Change who goes into Leads from Instagram and Messenger
PATCH/v1/social/settings
Read and writeIdempotent
qualified: only people who share a phone number or email, book, or are added by someone become leads (the rest stay conversations in Messages). everyone: every new DM person is a lead (and starts new-lead automations, webhooks and the field-service push like any new lead). Applies to people who message from now on; POST /v1/social/move-dm-leads tidies up the ones from before. Owners and admins.
Move Instagram and Messenger people back to Messages
POST/v1/social/move-dm-leads
Read and writeIdempotent
The settings' "Move them to Messages": Instagram and Messenger people who became New leads before (or while lead_mode was everyone) and never did anything a lead does (still New, no phone or email, no booking, deal or value, nobody added them to Leads) become conversations again. Silent: no automations, webhooks or field-service push; their conversations stay in Messages. apply false (the default) only counts them (would_move); apply true moves them (moved). Owners and admins.
The sub-account's Comment to DM rules (Settings > Instagram & Messenger): when someone comments on the business's Instagram or Facebook post, a rule can reply under the comment and send them a private message. Oldest first, which is the order they are tried in: the oldest active rule that matches a comment answers it, so a newer rule with the same keyword never sends. Each has account_ids (empty = every connected account), post_ids (empty = any post or reel), match (contains: a keyword appears as a whole word; exact: the whole comment is the keyword; any: every comment), keywords, public_replies (one is picked at random; empty = no public reply), dm_text, button, once_per_person, fired_count and last_fired_at. What each rule did is GET /v1/social/comments. Owners and admins, with Instagram & Messenger on for the account (403 not_enabled otherwise).
Makes a rule with the editor's own limits. It starts answering new comments as soon as it is saved active (the default): send active false to save it switched off. Keywords are cleaned as the editor does (a leading # dropped, no repeats in any case); with match any they are not used. A message with a button can be 640 characters, without one 1,000. account_ids must be this sub-account's connected accounts (GET /v1/social/accounts). Owners and admins, with Instagram & Messenger on.
Parameter
Description
name
body · string · required
The rule's name, up to 80 characters.
dm_text
body · string · required
The private message: up to 1,000 characters, 640 with a button.
match
body · string
contains (default), exact or any.
One of: contains, exact, any
keywords
body · array
Up to 20 keywords of up to 40 characters. Required unless match is any.
account_ids
body · array
Connected accounts the rule watches. Empty (default) = all of them.
post_ids
body · array
Up to 100 posts or reels (their ids on Instagram or Facebook). Empty (default) = any post.
public_replies
body · array
Replies under the comment, up to 10 of up to 300 characters; one is picked at random. Empty (default) = none.
button
body · object
{ label (up to 20 characters), url (https) }: a link button under the message. null = none.
once_per_person
body · boolean
Send each person this rule's message only once. Default true.
active
body · boolean
Default true.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/social/comment-rules" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"name": "Free guide",
"keywords": [
"guide"
],
"public_replies": [
"Check your DMs!"
],
"dm_text": "Here'\''s the guide you asked for.",
"button": {
"label": "Get the guide",
"url": "https://example.com/guide"
}
}'
Only what is sent changes, and the rule as a whole is checked again (adding a button to a 700-character message is refused). active false switches it off; button null removes the button. Owners and admins, with Instagram & Messenger on.
Parameter
Description
rule_id
path · string · required
The rule (from GET /v1/social/comment-rules).
name
body · string
Up to 80 characters.
active
body · boolean
On or off.
dm_text
body · string
Up to 1,000 characters, 640 with a button.
match
body · string
contains, exact or any.
One of: contains, exact, any
keywords
body · array
The whole list, up to 20.
account_ids
body · array
The whole list. Empty = every connected account.
post_ids
body · array
The whole list. Empty = any post.
public_replies
body · array
The whole list, up to 10. Empty = no public reply.
A sub-account's AI texting campaigns, newest first: who each texts, its goal and instructions, its texting hours, why it is paused or held (paused_because, on_hold), what keeps a draft from starting (start_problems: no texting number, rules that match nobody, nothing for the AI to say) and where its people stand (people: total, queued, waiting, replied, goal, needs_you, opted_out, no_reply, texted, replied_ever, texts_sent, first_today, next_send_at, goal_reached). Drafts carry matching_now: how many people starting it would text. Owners and admins of the sub-account.
Saves a new texting campaign as a draft: nobody is texted until POST /v1/text-campaigns/{campaign_id}/start. The AI writes each person's first text from what's on file (or sends your first_message), follows up with the ones who don't answer, and answers every reply with this campaign's goal and instructions, which win over the account's AI settings for these conversations (even with the account's AI texts off). A preset fills the name, goal and who it texts (not_booked: leads who never booked; win_back: Lost leads quiet 30+ days; past_customers; gone_quiet); with no preset and no audience it texts leads who never booked. Every value is checked and a wrong one refused with the allowed ones. The calendar and tags must be the sub-account's own. Owners and admins of the sub-account.
Parameter
Description
preset
body · string
A ready-made audience (GET /v1/text-campaigns/setup).
One of: not_booked, win_back, past_customers, gone_quiet, custom
name
body · string
Up to 120 characters. Default: the preset's name.
audience
body · object
Who it texts: stages (board columns: new, contacted, partial, qualified, booked, won, lost or a custom stage key; spam is never texted), sources, tag_ids (GET /v1/tags), skip_booked (default true), customers exclude | include | only (existing customers and Won leads), created_within_days, older_than_days, quiet_days (nothing either way for N days), skip_texted_days. A rule sent is laid over the preset's (or the campaign's) own.
rolling
body · boolean
Keep adding new leads who match while it runs. Default false.
goal
body · string
What the AI works towards in replies. Default book.
One of: book, collect, reply
offer
body · string
What the campaign is about, up to 1,500 characters.
instructions
body · string
How the AI should text these people, up to 4,000 characters. Wins over the account's AI instructions in these conversations.
agent_name
body · string
The name the AI texts as, up to 40 characters. Default the account's.
calendar_id
body · string
The calendar it books into (GET /v1/calendars). Default the account's.
reply_mode
body · string
auto answers replies by itself; approve has each reply wait for the team. Default auto.
One of: auto, approve
first_message_mode
body · string
ai writes each person's first text; template sends first_message. Default ai.
One of: ai, template
first_message
body · string
Your own first text, up to 480 characters, with {first_name}, {business} and the other variables of GET /v1/text-campaigns/setup.
opt_out_line
body · boolean
End the first text with Reply STOP to opt out. Default true.
follow_ups
body · number
Follow-ups to people who don't answer, 0-4. Default 2.
follow_up_gap_days
body · number
Days between texts, 1-14. Default 2.
follow_up_texts
body · array
Your own follow-ups, in order; "" lets the AI write that one.
nudge_quiet
body · boolean
One nudge when a conversation stops on our side for a day. Default true.
send_days
body · array
Days it may text: mon, tue, wed, thu, fri, sat, sun. Default mon-sat.
send_start
body · string
HH:MM in the sub-account's time zone. Default 09:00.
send_end
body · string
HH:MM, at least an hour after send_start. Default 19:00.
daily_cap
body · number
New people texted a day, 1-1000. Default 100.
run_days
body · number
How many days it runs once started, 1-120. Default 30.
start_at
body · string
Earliest moment it may text once started (ISO date and time).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/text-campaigns" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"preset": "win_back",
"offer": "15% off any repair this month",
"instructions": "Lead with the special. Short and casual."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/text-campaigns", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
preset: "win_back",
offer: "15% off any repair this month",
instructions: "Lead with the special. Short and casual.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/text-campaigns",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"preset": "win_back",
"offer": "15% off any repair this month",
"instructions": "Lead with the special. Short and casual.",
},
)
print(res.json())
The sub-account's texting number (has_texting_number: a campaign can't start without one), daily texting limit, its account-level AI (texts_on, goal, agent_name, reply_mode, instructions: what a campaign's own settings win over), prices in credits (a text, an AI reply), the ready-made audiences with how many people each would text now (presets[].matching_now), the goals and the variables a text may use. Owners and admins of the sub-account.
A count only, nobody is texted: how many people a set of rules would text right now (would_text), by the same rule a campaign enrols with, and who is held back and why (held_back: no_phone, cant_text, team: the AI is paused for them, other_campaign: in another live texting campaign, recent: heard from you recently; held_back_words says it in words), with up to three first names it would text. Rules: a preset, a campaign's own (campaign_id), or audience; audience is laid over either. Owners and admins of the sub-account.
Parameter
Description
preset
body · string
Start from a ready-made audience.
One of: not_booked, win_back, past_customers, gone_quiet, custom
campaign_id
body · string
Start from this campaign's own rules.
audience
body · object
Who it texts: stages (board columns: new, contacted, partial, qualified, booked, won, lost or a custom stage key; spam is never texted), sources, tag_ids (GET /v1/tags), skip_booked (default true), customers exclude | include | only (existing customers and Won leads), created_within_days, older_than_days, quiet_days (nothing either way for N days), skip_texted_days. A rule sent is laid over the preset's (or the campaign's) own.
{
"success": true,
"data": {
"would_text": 184,
"held_back": {
"no_phone": 12,
"cant_text": 9,
"recent": 31
},
"held_back_words": {
"no_phone": "no phone number",
"cant_text": "can't be texted (opted out or a bad number)",
"recent": "heard from you recently"
},
"sample_first_names": [
"Maria",
"Dan",
"Priya"
],
"audience": {
"stages": [
"new",
"contacted",
"partial"
],
"sources": [],
"tag_ids": [],
"skip_booked": true,
"customers": "exclude",
"created_within_days": null,
"older_than_days": null,
"quiet_days": 7,
"skip_texted_days": 2
},
"note": "A count only: nobody is texted. Spam is never texted; Won and Lost leads only when their stages are picked."
},
"error": null
}
Writes the text a campaign would send one real lead, as the editor's phone preview does: the campaign's saved settings (campaign_id) with any campaign field sent laid over them, or a draft of fields alone. step first (default) or follow_up (follow_up: which one, 1-4; earlier: the texts it would already have sent). lead_id picks whose text; left out, someone the campaign would text. Nothing is saved or sent. When the AI can't write it, text is null and could_not_write says why. Owners and admins of the sub-account.
Parameter
Description
campaign_id
body · string
Use this campaign's saved settings.
step
body · string
Which text. Default first.
One of: first, follow_up
follow_up
body · number
Which follow-up, 1-4.
lead_id
body · string
Whose text.
earlier
body · array
For a follow-up: up to 4 texts the campaign already sent them.
offer
body · string
Any field of POST /v1/text-campaigns overrides the saved one for this sample.
{
"success": true,
"data": {
"text": "Hi Maria, it's Sam at Delgado Garage Doors. We're doing 15% off any repair this month. Want me to find you a time this week? Reply STOP to opt out.",
"written_by": "ai",
"lead": {
"id": "uuid",
"name": "Maria Lopez"
},
"note": "A sample for one real lead: nothing was saved or sent. Each person gets their own text when the campaign runs."
},
"error": null
}
The campaign whole (the fields of POST /v1/text-campaigns), where its people stand (people), whether it is inside its texting hours now (texting_now, window_opens_at), matching_now and held_back_now: who its rules match right now, start_problems: what would stop a start (no texting number, a draft whose rules match nobody, nothing for the AI to say), and what_start_does: what starting it would do, in words to read to the person before they say yes. Owners and admins of the sub-account.
Changes only the fields sent (the fields of POST /v1/text-campaigns; audience rules are laid over the campaign's own). Never its status: that is start, pause and stop. While the campaign is texting, who it texts (audience, rolling) can't change: 409, pause it first. Owners and admins of the sub-account.
Parameter
Description
campaign_id
path · string · required
Campaign id.
preset
body · string
A ready-made audience (GET /v1/text-campaigns/setup).
One of: not_booked, win_back, past_customers, gone_quiet, custom
name
body · string
Up to 120 characters. Default: the preset's name.
audience
body · object
Who it texts: stages (board columns: new, contacted, partial, qualified, booked, won, lost or a custom stage key; spam is never texted), sources, tag_ids (GET /v1/tags), skip_booked (default true), customers exclude | include | only (existing customers and Won leads), created_within_days, older_than_days, quiet_days (nothing either way for N days), skip_texted_days. A rule sent is laid over the preset's (or the campaign's) own.
rolling
body · boolean
Keep adding new leads who match while it runs. Default false.
goal
body · string
What the AI works towards in replies. Default book.
One of: book, collect, reply
offer
body · string
What the campaign is about, up to 1,500 characters.
instructions
body · string
How the AI should text these people, up to 4,000 characters. Wins over the account's AI instructions in these conversations.
agent_name
body · string
The name the AI texts as, up to 40 characters. Default the account's.
calendar_id
body · string
The calendar it books into (GET /v1/calendars). Default the account's.
reply_mode
body · string
auto answers replies by itself; approve has each reply wait for the team. Default auto.
One of: auto, approve
first_message_mode
body · string
ai writes each person's first text; template sends first_message. Default ai.
One of: ai, template
first_message
body · string
Your own first text, up to 480 characters, with {first_name}, {business} and the other variables of GET /v1/text-campaigns/setup.
opt_out_line
body · boolean
End the first text with Reply STOP to opt out. Default true.
follow_ups
body · number
Follow-ups to people who don't answer, 0-4. Default 2.
follow_up_gap_days
body · number
Days between texts, 1-14. Default 2.
follow_up_texts
body · array
Your own follow-ups, in order; "" lets the AI write that one.
nudge_quiet
body · boolean
One nudge when a conversation stops on our side for a day. Default true.
send_days
body · array
Days it may text: mon, tue, wed, thu, fri, sat, sun. Default mon-sat.
send_start
body · string
HH:MM in the sub-account's time zone. Default 09:00.
send_end
body · string
HH:MM, at least an hour after send_start. Default 19:00.
daily_cap
body · number
New people texted a day, 1-1000. Default 100.
run_days
body · number
How many days it runs once started, 1-120. Default 30.
start_at
body · string
Earliest moment it may text once started (ISO date and time).
Request
cURL
curl -X PATCH "https://api.localflywheel.com/v1/text-campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"instructions": "Offer two times this week. Never bring up price first.",
"daily_cap": 60
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/text-campaigns/CAMPAIGN_ID", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
instructions: "Offer two times this week. Never bring up price first.",
daily_cap: 60,
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.patch(
"https://api.localflywheel.com/v1/text-campaigns/CAMPAIGN_ID",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"instructions": "Offer two times this week. Never bring up price first.",
"daily_cap": 60,
},
)
print(res.json())
Deletes the campaign and its list of people. Texts already sent stay in each conversation, and its people's replies go back to the account's AI settings. Owners and admins of the sub-account.
Start or resume an AI texting campaign (texts real people)
POST/v1/text-campaigns/{campaign_id}/start
Read and writeIdempotent
TEXTS REAL PEOPLE from the sub-account's number and spends credits, so confirm: true is required; an assistant must tell the person which campaign, how many people it would text (matching_now on GET /v1/text-campaigns/{campaign_id}) and when, and get a clear yes first. Starts a draft, resumes a paused campaign, or runs a finished one again with a fresh run window: everyone who matches its rules now is added and texted inside its texting hours, at most daily_cap new people a day. Refused (409) when it is already texting, the sub-account has no texting number, nobody matches, or something it needs is missing (start_problems); (402) when the account is out of credits. Answers added_people. Owners and admins.
Parameter
Description
campaign_id
path · string · required
Campaign id.
confirm
body · boolean · required
Must be true: real texts will go out and credits are spent.
No more texts until it is started again. Replies are still answered by the campaign's AI. Only a running campaign can be paused (409). Owners and admins of the sub-account.
Finishes it: nobody else is texted, people waiting for a follow-up are marked no reply, and conversations already going keep the campaign's AI. A draft is deleted instead (409). Start runs it again. Owners and admins of the sub-account.
50 people at a time: each one's lead, state (queued: up next, waiting: texted, replied, goal, needs_you: with the team, opted_out, no_reply, stopped, skipped, failed) in words, why they left, texts and follow-ups sent, when the next text goes, their last text and last reply. Owners and admins of the sub-account.
Parameter
Description
campaign_id
path · string · required
Campaign id.
filter
query · string
Default all.
One of: all, active, replied, goal, needs_you, no_reply, out
Every setting POST / PATCH /v1/calendars takes, read the way the booking page reads it: hours, length, buffers, hosts' mode, texts, pricing (with each option's and add-on's id, used by availability and bookings), design, duration_days (full-day jobs), schedule_group (shared schedule), fields and questions (the booking form), image_url, the payment settings, a summary (price_from_cents, price_to_cents, length_label such as "4-6 hr", has_options, takes_payment) and booking_path (/c/<slug>).
The times the calendar's booking page offers, worked out the same way: weekly hours and days off, the job length, buffers, capacity (slots_per_window jobs at one moment), calendars sharing its schedule, max per day, minimum notice, the booking window (max_days_ahead, up to a year) and the hosts' own calendars. A calendar with options times each one differently, so send option_id (400 lists the options otherwise) and any addon_ids; the answer carries a quote (option, add-ons, length, total, deposit, balance). Full-day calendars also return slot_ends (when each start's job is done). Always call this before creating a booking.
Parameter
Description
calendar_id
path · string · required
Calendar id.
from
query · string
A date (2026-11-03) or an ISO time; defaults to today.
days
query · number
1-42, default 7.
option_id
query · string
The option picked (its id in GET /v1/calendars pricing.options). Required on a calendar with options.
addon_ids
query · string
Add-on ids, comma-separated: they add their time to the job.
Soonest first. Each appointment has the same fields as everywhere else in the API: id, lead_id, calendar_id, appointment_number (the sub-account's #1001 and up, as the calendar shows it), title, starts_at, ends_at, timezone, lead_timezone, location, notes, meeting_type, meeting_location, meeting_url, host_user_id, status, source, notify_lead, is_arrival_window (booked as an arrival window: starts_at to ends_at is the window), service_details (on a priced calendar: the service, option, add-ons, length, total_cents, deposit_cents, balance_cents and currency; null otherwise), created_at and updated_at. For owners and admins each also carries manage_url: the customer's own page for it (the {reschedule_link} of reminders, on the sub-account's CRM address), where they move or cancel it themselves; add ?cancel=1 to open on cancelling.
The emails a lead gets when they book (confirmed), when the appointment moves (updated) and when it's cancelled, each with the calendar invite attached (Settings > Messaging > Appointment Reminders > Confirmation email). enabled false: leads get none (the team still gets its booking alert); language of our emails (en or es). For each kind sends says whether ours or the business's own HTML goes out, with its subject (default_subject when empty) and HTML. variables lists what the subject and HTML can use. Owners and admins.
Send appointment emails in the business's own HTML
PUT/v1/appointment-emails
Read and writeIdempotent
Change any of the three (confirmed, updated, cancelled) field by field: html (the whole email, any design: a GoHighLevel or Mailchimp export works; scripts, frames, forms and javascript: links are removed), subject (up to 200 characters; empty uses the default) and on; starter: true starts from the built-in template; null puts our email back. New HTML goes out unless on is false; a kind without HTML is ours. Variables are filled for each lead, HTML-escaped: {first_name}, {full_name}, {when}, {date}, {time}, {location}, {join_link}, {reschedule_link}, {cancel_link}, {appointment_title}, {business}, {business_phone}, {agent}; a misspelled one stays as typed. Also enabled and language. The .ics invite is attached either way. Owners and admins.
Parameter
Description
confirmed
body · object
{ on, subject, html } or { starter: true }; null = our email.
Books like the app: rejects a second overlapping appointment for the same lead; calendar_id must be one of the sub-account's calendars (404 otherwise); ends_at must be after starts_at and at most 24 hours later. With a calendar, the slot's capacity is checked, calendars sharing its schedule included (409 with code slot_full; pick a time from GET /v1/calendars/{calendar_id}/availability, or send force: true) and the host is picked by the calendar's round robin. On a priced calendar, option_id and addon_ids set the job's length and price: the booking's notes start with the pick and its service_details carry the option, add-ons, total, deposit and balance; the lead's deal value is filled when it has none (the response adds a quote; a warning says when a calendar with options was booked without one). Bookings made through the API never take the deposit: to collect it, send the customer the booking link. A full-day calendar's job starts at opening time and ends at closing time on its last working day (400 not_a_start_time otherwise, unless ends_at is sent). By default the lead gets the confirmation and reminder texts and the calendar invite (notify_lead: false to skip them). Fires the appointment.booked outbound webhooks.
Parameter
Description
starts_at
body · string · required
ISO 8601 start time.
ends_at
body · string
ISO 8601 end time (instead of duration_minutes; at most 24 h after starts_at, 31 days on a full-day calendar).
lead_id
body · string
Lead to book.
calendar_id
body · string
One of the sub-account's calendars.
option_id
body · string
The option booked (GET /v1/calendars pricing.options id), e.g. the vehicle size.
addon_ids
body · array
Add-ons booked (pricing.addons ids).
duration_minutes
body · number
5-1440. Default: the option's length with its add-ons, else the calendar's, else 30.
timezone
body · string
IANA timezone.
location
body · string
Meeting location.
notes
body · string
Internal notes.
notify_lead
body · boolean
Default true: the lead gets the confirmation email with its calendar invite plus the confirmation and reminder texts. false books quietly, and later updates or cancels stay quiet too; the host still gets the booking alert.
force
body · boolean
Skip the calendar's capacity check (the database still never double-books a person or a full calendar).
Re-times the reminder texts, updates the calendar mirror and the lead's invite, and fires the appointment.rescheduled outbound webhooks when the time changed. The appointment keeps its length; a full-day job runs to closing time on its new last working day. 409 slot_full when the new time is taken.
Change an appointment's outcome, title, notes, location, host, lead notifications or lead
PATCH/v1/bookings/{booking_id}
Read and writeIdempotent
Everything but the time (use reschedule for that). status records the outcome: completed, no_show or cancelled release the lead from Booked and stop its reminder texts; confirmed puts it back on. host_user_id must be someone on the sub-account's team (GET /v1/members). notify_lead: false silences the lead's remaining reminder texts and invite updates; true turns them back on (an upcoming appointment's reminders are queued again). lead_id links an appointment that has no lead yet (typed in by hand) to a lead of the same sub-account; one that already has a lead answers 409. Linking an upcoming scheduled appointment books it for the lead like a new booking: the lead is marked booked, its follow-ups and AI calls stop, and the confirmation and reminder texts and the invite go out (unless notify_lead is false). A past or finished appointment is only linked.
Parameter
Description
booking_id
path · string · required
Booking id.
status
body · string
The appointment's outcome.
One of: confirmed, completed, no_show, cancelled
title
body · string
Max 200.
notes
body · string
Max 2000. null clears them.
location
body · string
Address or place, max 300. null clears it.
host_user_id
body · string
Team member who takes it. null for nobody.
notify_lead
body · boolean
false: the lead gets no more reminder texts or invite updates for this appointment. true: they do again.
lead_id
body · string
Link an appointment with no lead to this lead (same sub-account). Cannot move an appointment from one lead to another.
Each member has user_id, role, email and full_name. Use user_id (or the email) to name a team member in busy blocks. Staff and Technicians, who have no Team page in the app, get names and roles only (no emails, no invitations).
Starts unpublished with the same defaults as a form created in the app. The response includes its public path (/f/<slug>), qualifier_questions, custom_fields, qualification, calendar_routing, service_area and estimate. Questions can ask for photos (field_type file) and put a price on answers (option_prices) for the instant estimate: switched on with estimate, the answers' prices add up to a live total in the form's footer, saved on the lead with its total as the deal value. Qualification routes each lead to Qualified, Nurture or Not eligible: yes/no qualifier_questions (asked first when qualifier_enabled is on) and choice questions with disqualify_options or nurture_options. A service area (fields.address.service_area) only accepts addresses in chosen US states or within a radius: address suggestions stay inside it and an out-of-area visitor sees your message and cannot send the form; switching it on shows and requires the address, like the builder. Design and tracking pixels are edited in the app.
Parameter
Description
name
body · string · required
Form name (max 80).
headline
body · string
Max 160.
subheadline
body · string
Max 300.
primary_color
body · string
#rrggbb.
bullet_points
body · array
Up to 8 short lines.
layout_mode
body · string
The builder's Layout: single_step (one page, the default), multi_step (a step-by-step wizard), conversational (one question at a time, like a chat) or funnel (one big question per screen).
One of: single_step, multi_step, conversational, funnel
calendar_id
body · string
Calendar used by the booking step.
calendar_routing
body · boolean
Pick the calendar from the answers: the sub-account's calendar routing rules (/v1/calendar-routes) choose which calendar's times the form shows once the deciding question is answered; calendar_id is used when no rule fits.
booking_enabled
body · boolean
Show the booking step.
fields
body · object
Contact fields: {"email":{"required":false},"address":{"enabled":false}}. Keys: first_name, last_name, phone, email, address, state (a State / Province pick list), notes. Phone or email must stay on. address also takes service_area (merged): {"enabled":true,"mode":"states","states":["TX","OK"],"message":"Sorry, we only serve Texas and Oklahoma."}, or mode "radius" with "center":{"lat":32.7767,"lng":-96.797,"label":"Dallas, TX"} and "radius_miles" (1-500, default 25). A blank message shows "Sorry, we don't service this area yet."; null or enabled:false switches it off.
is_published
body · boolean
Default false.
show_logo
body · boolean
Off hides the logo above the headline and in the flow's header.
headline_size
body · string
The headline's own size; auto is what the layout picks.
One of: auto, small, medium, large
submit_note
body · string
Small print right above the submit button (consent, a disclaimer), up to 400 characters; null removes it.
steps_hint
body · boolean
Booking forms: "Complete the steps above to book." under the button. Off hides it.
details_heading_on
body · boolean
Single page and step by step: the heading above the contact details ("1. Your information"). Off hides it; on by default.
details_heading
body · string
That heading's words, up to 80 characters; null = "Your information" in the visitor's language.
section_numbers
body · boolean
Single page: "1." "2." in front of each section's heading. Off drops them; on by default.
video
body · object
A video sales letter at the top (Builder > Content > Video at the top): { url: a YouTube (watch, youtu.be, Shorts), Vimeo, Loom or Wistia link, or an https link to a video file; position: below (default) or above the headline; autoplay (muted, with a Tap for sound button); poster (a cover picture for a file); ratio (width / height, default the video's own); enabled }. A new url turns it on; fields left out keep what the form has; null turns it off and keeps the link. The response carries video.
qualifier_enabled
body · boolean
Ask the qualifier_questions first.
qualifier_questions
body · array
Up to 10, replaces the list: [{ text (max 200), disqualify_on: "yes" | "no" (default "no"), outcome: "not_eligible" | "nurture" (default "not_eligible") }].
questions
body · array
Custom questions, up to 30, replaces the list: [{ key?, label (max 160), field_type: text | textarea | number | money | phone | email | url | select | multiselect | boolean | date | datetime | rating | file (photos or PDFs, up to 6, shown on the lead), options (select / multiselect: 2-40), option_prices? (select / multiselect: cents per answer for the instant estimate, e.g. {"SUV": 8000}; left out keeps the saved prices, null removes them), disqualify_options? or nurture_options? (choice types; boolean answers "yes" / "no"; never both), placement?: "qualify" | "details" (qualify = choice types only), option_style?: dropdown | buttons | cards | auto, no_first? (boolean: show No before Yes), after_contact? (details questions: asked after name, phone and email, e.g. a Comments box at the bottom; left out keeps the saved spot), allow_other? (select / multiselect: an Other answer with a box for their own words; left out keeps the saved choice), required?, enabled?, save_to_crm? (never for file), placeholder?, helper_text? }].
The instant price estimate, merged: { enabled, label (default "Your estimate"), base_cents (added before any answer), note (e.g. "Final price after we see the job"), range_percent (0-50: shown as a range that far either side) }. null switches it off.
hidden_fields
body · array
Values the visitor never sees, sent with each lead (the 20 at most; {key} and {cf_key} work in messages). Each { key, label, source, param, page, value }: source param reads ?<param>= (default the key) on the form link or the page it is embedded on (or the embed code's data-field-<key>); page reads the embedding page: page = year, make, model, price, vin, sku, condition, item, title, heading or url (the listing's schema.org data, the title, the main heading...), css:<selector> or meta:<name>; fixed is always value (value is also the fallback when a param or page finds nothing).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/smart-forms" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"name": "Roof quote",
"qualifier_enabled": true,
"qualifier_questions": [
{
"text": "Do you own the home?",
"disqualify_on": "no",
"outcome": "not_eligible"
}
],
"questions": [
{
"label": "When do you want to start?",
"field_type": "select",
"options": [
"This month",
"In 1-3 months",
"Just researching"
],
"nurture_options": [
"Just researching"
],
"placement": "qualify"
},
{
"label": "Vehicle size",
"field_type": "select",
"options": [
"Car",
"SUV",
"Truck"
],
"option_prices": {
"Car": 31500,
"SUV": 38500,
"Truck": 45000
}
},
{
"label": "Photos of the damage",
"field_type": "file"
}
],
"qualification": {
"save_not_eligible": true
},
"estimate": {
"enabled": true,
"note": "Final price after we see the job",
"range_percent": 10
}
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/smart-forms", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
name: "Roof quote",
qualifier_enabled: true,
qualifier_questions: [
{
text: "Do you own the home?",
disqualify_on: "no",
outcome: "not_eligible",
},
],
questions: [
{
label: "When do you want to start?",
field_type: "select",
options: ["This month", "In 1-3 months", "Just researching"],
nurture_options: ["Just researching"],
placement: "qualify",
},
{
label: "Vehicle size",
field_type: "select",
options: ["Car", "SUV", "Truck"],
option_prices: {
Car: 31500,
SUV: 38500,
Truck: 45000,
},
},
{
label: "Photos of the damage",
field_type: "file",
},
],
qualification: {
save_not_eligible: true,
},
estimate: {
enabled: true,
note: "Final price after we see the job",
range_percent: 10,
},
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/smart-forms",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"name": "Roof quote",
"qualifier_enabled": True,
"qualifier_questions": [
{
"text": "Do you own the home?",
"disqualify_on": "no",
"outcome": "not_eligible",
},
],
"questions": [
{
"label": "When do you want to start?",
"field_type": "select",
"options": ["This month", "In 1-3 months", "Just researching"],
"nurture_options": ["Just researching"],
"placement": "qualify",
},
{
"label": "Vehicle size",
"field_type": "select",
"options": ["Car", "SUV", "Truck"],
"option_prices": {
"Car": 31500,
"SUV": 38500,
"Truck": 45000,
},
},
{
"label": "Photos of the damage",
"field_type": "file",
},
],
"qualification": {
"save_not_eligible": True,
},
"estimate": {
"enabled": True,
"note": "Final price after we see the job",
"range_percent": 10,
},
},
)
print(res.json())
Everything about one form, to read before changing it: the basics, questions, qualifier questions, fields, qualification, estimate and hidden fields (as POST /v1/smart-forms takes them), design (every Design tab setting with its current value), screens (flow, thank_you, disqualified_page), logo_url, favicon_url, offer_ids, views, submissions, public_url, and embed: snippet (a container plus the loader script, the recommended way to put it on a website), iframe (for site builders that strip scripts) and script_url. Any member of the sub-account.
The words and behaviour of the screens around the questions (the builder's Screens tab). Send only what changes; null puts a setting back to its default. flow: welcome { enabled, cta_label, note }, contact { eyebrow, headline, subheadline, consent_label, consent_required }, booking { eyebrow, headline }, name { first (ask for their name on its own screen first), headline, subheadline }, progress (both, bar, counter, none), transition (slide, fade, none), question_numbers, keyboard_hints, recall_name, auto_advance, media { url, position: left | right } (the picture or video beside a conversational form), question_images { <question key>: https link } (replaces the map), footer_links [{ label, url }] (up to 4, replaces the list). thank_you: headline, subheadline, cta_label, cta_url, show_calendar_links, calendar_description. disqualified_page (who the form screens out lands here): headline, subheadline, cta_label, cta_url. The questions themselves are PATCH /v1/smart-forms/{form_id} (questions, qualifier_questions). Answers the whole form. Owners and admins.
Parameter
Description
form_id
path · string · required
Form id.
flow
body · object
Welcome, contact, booking and name screens, progress, pictures, footer links (merged).
thank_you
body · object
The thank-you page (merged).
disqualified_page
body · object
The page for people the form screens out (merged).
Request
cURL
curl -X PATCH "https://api.localflywheel.com/v1/smart-forms/FORM_ID/screens" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"flow": {
"welcome": {
"enabled": true,
"cta_label": "Get my quote"
},
"name": {
"first": true
}
},
"thank_you": {
"headline": "You'\''re booked in",
"subheadline": "We'\''ll text you a confirmation in a minute.",
"show_calendar_links": true
}
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/smart-forms/FORM_ID/screens", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
flow: {
welcome: {
enabled: true,
cta_label: "Get my quote",
},
name: {
first: true,
},
},
thank_you: {
headline: "You're booked in",
subheadline: "We'll text you a confirmation in a minute.",
show_calendar_links: true,
},
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.patch(
"https://api.localflywheel.com/v1/smart-forms/FORM_ID/screens",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"flow": {
"welcome": {
"enabled": True,
"cta_label": "Get my quote",
},
"name": {
"first": True,
},
},
"thank_you": {
"headline": "You're booked in",
"subheadline": "We'll text you a confirmation in a minute.",
"show_calendar_links": True,
},
},
)
print(res.json())
A copy in the same sub-account with every setting, question, design, screen and offer of the original, a new link, unpublished, with no views or submissions. name is optional (default "<name> (copy)"). Copying into another sub-account stays in the app. Owners and admins.
Deletes the form; its link and embeds stop working. A form with submissions answers 409 (details.code needs_confirm) until confirm=true is sent: the submission records are deleted with it, the leads they made stay. Cannot be undone. Owners and admins.
The sub-account's own domains for Smart Forms and Smart Pages: hostname, verified, verified_at, ownership_status, ssl_status, last_checked_at and problem (what the last check found, if anything). Read only: a domain is connected and checked in the app. People who manage the sub-account.
Read a smart form's tracking, coupon and booking settings
GET/v1/smart-forms/{form_id}/settings
Read only
What GET /v1/smart-forms/{form_id} leaves out: tracking (meta pixels with their event, ga4, tiktok, google_ads), thank_you_offer (the thank-you page's coupon, and shown: whether the page shows it) and booking (calendar_id, scheduling_mode, lengths, notice, time zone, host, custom hours). Any member of the sub-account.
The form's Pixels tab. Only what is sent changes; null clears. meta: up to 10 Meta pixels [{ id (digits), event (fired after a submission; default Lead) }], replacing the list. ga4: a Google Analytics 4 id (G-XXXXXXXX). tiktok: a TikTok pixel id. google_ads: { id (AW-...), label } for the conversion fired after a submission. Each id must be in its platform's own shape (400 otherwise). Answers the settings view. Owners and admins.
Parameter
Description
form_id
path · string · required
Form id.
meta
body · array
Meta pixels: [{ id, event? }], up to 10. Replaces the list; null or [] removes them.
The coupon the thank-you page shows after a booking. Only what is sent changes; null clears a field. enabled, headline (up to 80), code (up to 40, saved in capitals), description (up to 300), cta_label (up to 40), cta_url (a phone number becomes a call link; or an https, tel:, mailto: or sms: link), disclaimer (up to 200). It shows once enabled with a headline or description (shown in the answer). The rest of the thank-you page is PATCH /v1/smart-forms/{form_id}/screens. Owners and admins.
Parameter
Description
form_id
path · string · required
Form id.
enabled
body · boolean
Show the coupon.
headline
body · string
The offer, e.g. $500 OFF.
code
body · string
A code the customer can mention.
description
body · string
One line on what they get.
cta_label
body · string
Button label.
cta_url
body · string
Phone number or link for the button.
disclaimer
body · string
Small print.
Request
cURL
curl -X PATCH "https://api.localflywheel.com/v1/smart-forms/FORM_ID/thank-you-offer" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"enabled": true,
"headline": "$500 OFF",
"code": "CALLNOW500",
"description": "Call now and mention this code to lock in $500 off your install.",
"cta_label": "Call now to claim",
"cta_url": "(555) 123-4567"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/smart-forms/FORM_ID/thank-you-offer", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
enabled: true,
headline: "$500 OFF",
code: "CALLNOW500",
description: "Call now and mention this code to lock in $500 off your install.",
cta_label: "Call now to claim",
cta_url: "(555) 123-4567",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.patch(
"https://api.localflywheel.com/v1/smart-forms/FORM_ID/thank-you-offer",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"enabled": True,
"headline": "$500 OFF",
"code": "CALLNOW500",
"description": "Call now and mention this code to lock in $500 off your install.",
"cta_label": "Call now to claim",
"cta_url": "(555) 123-4567",
},
)
print(res.json())
The form's own booking settings. Only what is sent changes. scheduling_mode (exact | arrival_window; arrival windows run back to back, so buffer_minutes is then 0), slot_minutes 5-480, buffer_minutes 0-240, arrival_window_minutes 30-480, max_days_ahead 1-365, min_notice_hours 0-720, slots_per_window 1-50 (bookings that can share one time), timezone (IANA; null = the sub-account's), host_user_id (a member of the sub-account; null = its owner), use_custom_hours with weekly_hours ({ mon: [["09:00","17:00"]], ... }; a day left out is closed; null removes them). A form assigned to a booking calendar follows that calendar's hours, lengths and mode instead. Turning booking on or off and picking the calendar are PATCH /v1/smart-forms/{form_id} (booking_enabled, calendar_id). Owners and admins.
Parameter
Description
form_id
path · string · required
Form id.
scheduling_mode
body · string
exact or arrival_window.
One of: exact, arrival_window
slot_minutes
body · number
Appointment length, 5-480.
buffer_minutes
body · number
Gap between appointments, 0-240.
arrival_window_minutes
body · number
Arrival window length, 30-480.
max_days_ahead
body · number
How far ahead people can book, 1-365 days.
min_notice_hours
body · number
Minimum notice, 0-720 hours.
slots_per_window
body · number
Bookings per time, 1-50.
timezone
body · string
IANA time zone, or null.
host_user_id
body · string
The member bookings belong to, or null.
use_custom_hours
body · boolean
Use weekly_hours instead of the sub-account's hours.
Adds a domain for the sub-account's Smart Forms and Smart Pages (and, once verified, its CRM address): a root domain (example.com) or a subdomain (forms.example.com), written with or without https://. It is saved unverified and the answer carries dns, the record to create at the domain's DNS provider: one CNAME to portal.usezu.com for a subdomain; for a root domain the provider's alias-style record (ALIAS / ANAME / CNAME flattening), or A records (their addresses come with a check). Then call POST /v1/smart-forms/domains/{domain_id}/verify. A hostname has one owner: 409 already_added (with its id) when this sub-account has it, 409 domain_taken when another account or the white-label settings hold it. People who manage the sub-account.
Parameter
Description
hostname
body · string · required
The domain, like example.com or forms.example.com.
The app's Check: looks up where the hostname points right now. When it points here the domain becomes verified and its secure certificate is issued within minutes (live true once it is ready; forms and pages open on it from then). The answer is the domain (verified, live, ssl_status, problem: what the check found in plain words, dns: the record to create) plus points_to (the end of its CNAME chain), addresses (its A records) and edge_addresses (the addresses a root domain's A records may use). DNS changes often take 5 to 30 minutes: check again later rather than in a loop; pending domains are also re-checked on a timer. People who manage the sub-account.
Parameter
Description
domain_id
path · string · required
The domain's id (from GET or POST /v1/smart-forms/domains).
Removes the domain from the sub-account. Smart Pages on it go back to their shared link, forms stop opening on it, and a CRM address that used it goes back to the agency's. The DNS record at the provider is the business's to delete. People who manage the sub-account.
Takes the same fields as create; send only what changes. questions, qualifier_questions and hidden_fields replace their lists; qualification, estimate, fields and fields.address.service_area are merged.
Parameter
Description
form_id
path · string · required
Form id.
is_published
body · boolean
Publish or unpublish.
layout_mode
body · string
single_step, multi_step, conversational or funnel (see create).
One of: single_step, multi_step, conversational, funnel
qualifier_enabled
body · boolean
Ask the qualifier_questions first.
qualifier_questions
body · array
Replaces the list (see create).
questions
body · array
Replaces the list (see create).
qualification
body · object
Merged (see create).
estimate
body · object
Merged (see create).
calendar_routing
body · boolean
Pick the calendar from the answers (see create).
fields
body · object
Merged, including address.service_area (see create).
video
body · object
The video at the top, merged (see create); null turns it off.
hidden_fields
body · array
Replaces the list (see create); null or [] clears it.
The sub-account's surveys: Smart Forms that ask for feedback (a funnel with no booking and no screening). A survey never makes a lead: an answer lands on the lead the personal link belongs to, or on one matched by the phone or email typed, else it stays on the survey. Each has live, the message its link goes out in, rules (when it sends itself) and its questions. Add or change questions with PATCH /v1/smart-forms/{form_id} (questions).
A new survey from one of the app's five starts, with its questions, message and rule, as a draft: it sends nothing until it is live (PATCH /v1/surveys/{form_id}/rules with live: true). Owners and admins. A sub-account keeps at most 100 Smart Forms.
Parameter
Description
template
body · string
Which start. Default blank.
One of: lost_deal, won_deal, check_in, recommend, blank
The Results tab as data. totals: answers, and of the links that went out how many were opened and answered. questions: per question, answers with counts and percents and other_words (what people typed under Other); a rating's average, scores 1-10, gave_9_or_10_pct and gave_6_or_less_pct; a number's average; written answers (the first 50, written_total says how many). responses: every answer, a page at a time. Covers the newest 2,000 answers (capped says so). Every member can read it.
rules replaces the list (up to 4): when a deal is marked Won or Lost, the survey goes to that person after the wait, once per rule and person in 180 days, and not if the deal has moved on by then. A rule on these messages real people automatically. Send a rule's key to keep it; without one it takes over the old rule for the same event. message and subject are what the personal link goes out in ({first_name}, {business_name}, {survey_link}). live turns the survey on or off. Send any of these; the rest stay. Owners and admins.
Parameter
Description
form_id
path · string · required
Survey id.
rules
body · array
Up to 4 of { key, when: lost | won, delay: { amount, unit: hours | days | weeks | months }, channel: sms | email | both, on }.
Messages real people: each lead gets their own link, by text, email or both, through the queue (quiet hours, daily limits, STOP). The first 25 go at once, the rest within minutes. Up to 200 a send. The survey must be live (400 otherwise). Get lead ids from GET /v1/leads. Owners and admins.
Parameter
Description
form_id
path · string · required
Survey id.
lead_ids
body · array · required
1-200 lead ids.
channel
body · string
Default sms (text; someone with only an email gets it by email).
Their own link, to send however you like; nothing is sent. The same link comes back while it's unanswered (30 days). Answers land on this lead, with no name or phone asked. live says whether the survey is on, because a draft's links don't work yet. Owners and admins.
Can send real texts and emails. Confirm the lead list before calling. Leads are queued and start within the sub-account's daily contact limit. A lead already waiting in this automation's queue is not queued again (already_queued). ignore_filters defaults to false: a lead that fails the automation's only_if rules is skipped when the queue reaches it (the app's Enroll dialog defaults to true).
Parameter
Description
automation_id
path · string · required
Automation id.
lead_ids
body · array · required
Lead ids (max 5000).
ignore_filters
body · boolean
Default false: leads that fail the automation's only_if rules are skipped. true = enroll them anyway.
Every trigger, step, filter and setting the builder accepts
GET/v1/workspace-automations/reference
Read only
Read this before building: trigger types and their filters, step actions and their fields, entry-rule fields and operators (with every lead source), settings, message variables, and what this sub-account has for a definition to point at: stages, team, custom fields, phone numbers, review funnel, Facebook pages, Smart Forms, form names (for form_name rules), calendars and email senders.
The shape of a send_email step's design (format designed): its fields, every section (text, offer, image, features, steps, review, gallery, banner, questions, services, button, divider, custom HTML), the looks it can have, the rules (merge fields, [bracketed blanks], no invented facts) and a whole example step. A designed email is drawn in the business's own logo, name and address with a footer and Unsubscribe link, exactly as the Automations page's email designer shows it. The same for every sub-account.
Saved exactly as the Automations page saves it, so it opens and edits in the app. Saved OFF unless enabled is true; once on, its texts and emails go to real leads through the normal quiet hours, opt-out and daily limits. Steps can send lead data out (webhooks, alerts), so this needs an admin-scoped key. Everything it points at (stages, team members, phone numbers, review pages, Facebook pages, Smart Forms, calendars, email senders) must be in the same sub-account; GET /v1/workspace-automations/reference lists them. Any step can take a label (its name on the step card). Steps include drip (let a number of leads through every period, the rest wait in line, within business hours if asked); triggers include custom_field_changed (a custom field changes, optionally to certain values or only by a person) and yearly_date (every year on a holiday or a date, at a time, for everyone matching only_if that day). An inbound_webhook automation comes back with its private inbound_url: POST JSON with a phone or email to start it (it must be on), and every field sent can be used in its messages as {field}.
Parameter
Description
name
body · string · required
Up to 80 characters.
description
body · string
Optional note.
trigger
body · object · required
When it starts: {"type":"new_lead"}, {"type":"stage_changed","to_stages":["booked"]}, {"type":"tag_added","tags":["hot"]}, {"type":"leads_imported","tags":["Foreclosure list"]}, {"type":"smart_form_submitted","form_ids":["Free quote"]}, {"type":"appointment_booked","calendar_ids":["Estimate visit"]}, {"type":"inbound_webhook"}... Ids or names. See GET /v1/workspace-automations/reference.
only_if
body · array
Entry rules, all must hold: [{"field":"tags","op":"has_none","value":["customer"]}].
steps
body · array · required
In order: [{"action":"send_text","message":"Hi {first_name}"},{"action":"wait","days":1},{"action":"send_email","subject":"Your quote","message":"..","from_sender_id":"<email sender id, address or name>"},{"action":"if","conditions":[..],"then":[..],"else":[..]}]. A send_text step takes send_as (auto, imessage or sms) when the sub-account has an iMessage Mac, plus voice_note_url (an https audio file sent right after the message, only from a connected iPhone number, never the business number; the step is skipped when no iPhone is connected) and video_url (texted as a link under the message). A send_email step takes format: simple (the default, message as rich text), designed (a branded email built from sections: design {headline, heroImageUrl, greeting, blocks [{type:text, md} | offer | image | features | steps | quote | gallery | banner | faq | cards | button | divider], ctaLabel, ctaUrl ({booking_link}, {review_link}, {reschedule_link} or https), signoff, signerName, accent, design {template classic|bold|letter|flyer|newsletter|elegant|minimal|bright|fresh|blocks|retro|night|soft}}; GET /v1/workspace-automations/email-design has the whole shape and an example) or html (html: the whole email in your own HTML; {first_name}, {{contact.first_name}} and *|FNAME|* are filled). Designed and html emails need a subject, get the business's logo, address and an Unsubscribe link, and their split_test b is {subject, preheader}.
One automation as {trigger, only_if, steps, settings}
GET/v1/workspace-automations/{automation_id}
Read only
The same shape create and update take (step names included), with a ref on every step so an update can keep steps unchanged ({"keep":"<ref>"}). Webhook header values are hidden. An inbound_webhook automation includes its inbound_url; viewers see only its host, like webhook step links.
Every Send text and Send email step with its sends, opens, clicks, hard bounces and replies within 7 days of each send, the numbers in the app's Stats view. Rates are fractions (0.25 = 25%). A text has no opens, clicks or bounces: those are null. A step with a split test also has split_test: each version's numbers and a verdict. status is too_early (fewer than 30 sends on a version; sends_needed says how many more), tie, leading (ahead, could still be chance) or winner (95% confidence); metric is what it is judged on (clicks for an email with at least 5 clicks, else opens; replies for a text); lift is how far ahead as a fraction, null when the other version's rate is 0. Steps are matched by their place in the automation; sends from a place that no longer holds that kind of step are in steps_no_longer_there. partial is true when the period has more runs than the 2,000 newest counted.
Send only what changes. steps replaces all steps: keep unchanged ones with {"keep":"<ref>"} from GET. settings changes only the keys sent. enabled turns it on or off.
The folders on the Automations page in their order, the automations in each, and the ones at the top level. GET /v1/workspace-automations also takes folder_id (or none for the top level).
A draft invoice, numbered like the app's: for a lead (lead_id fills in the customer and is needed to send it) or a customer_name, with its lines. Tax, due date, terms, notes and card payments default to the sub-account's invoice settings; a tax_rate sent is one plain tax in place of them, or send taxes for named ones (GST + QST), each on its own line with the registration number from the settings. Totals are worked out as the editor does: each line rounded, discount_cents off the subtotal (never more than it) and spread over the taxable lines, each tax rounded on its own. deposit_percent or deposit_cents makes it a deposit invoice: it lists the whole job and total_cents is the deposit asked for now. Owners and admins of the sub-account. Card payment pages are set up in the app.
Parameter
Description
lead_id
body · string
Who it is for (fills in the customer; needed to send it). Or customer_name.
items
body · array · required
The lines, 1-100: [{ description (the line's name, max 300), quantity? (above 0, default 1), unit_price_cents (whole cents; below zero for a credit line), taxable? (default true) }].
tax_rate
body · number
One tax, percent 0-30. Default: the sub-account's taxes.
taxes
body · array
Instead of tax_rate, up to 4 named taxes: [{ name, rate }], e.g. GST 5 + QST 9.975.
discount_cents
body · number
Off the subtotal, whole cents. Default 0.
deposit_percent
body · number
Ask for this percent of the job now (above 0, up to 100). Or deposit_cents.
deposit_cents
body · number
Ask for this amount now, whole cents.
due_date
body · string
YYYY-MM-DD, or null for no due date. Default: the sub-account's due days from today.
due_days
body · number
Instead of due_date: due this many days from today (0-365).
issue_date
body · string
YYYY-MM-DD, default today.
notes
body · string
A note to the customer (max 4000). Default: the sub-account's.
terms
body · string
Max 4000. Default: the sub-account's.
currency
body · string
3 letters. Default: the sub-account's.
collect_payment
body · boolean
Whether the customer may pay by card once a payment page is set up in the app. Default: the sub-account's.
customer_name
body · string
Without a lead, or to change what the lead fills in.
Send only what changes. items replace every line, as the editor saves; new lines, taxes, a discount or a deposit work the totals out again (a percent deposit follows the new total, an amount stays). lead_id: null unlinks it; a new lead fills in the customer unless you send the details. deposit_percent: null takes a deposit away. An invoice that has been paid (in full or in part) answers 409: make a new one. One that already has a hosted card payment page for its amount answers 409 on anything that changes the amount: change it in the app, which makes the page again. A balance invoice (billed after a deposit) keeps its currency and can't ask for another deposit. Owners and admins.
Parameter
Description
invoice_id
path · string · required
Invoice id.
lead_id
body · string
Who it is for, or null.
items
body · array
Replaces every line: [{ description, quantity?, unit_price_cents, taxable? }].
tax_rate
body · number
One tax, percent 0-30, in place of the invoice's taxes.
taxes
body · array
Named taxes in place of the invoice's: [{ name, rate }].
The Invoices list's Delete: the invoice goes with its lines and history, and its customer link stops working. An invoice that has been paid (in full or in part) is a record and answers 409. Owners and admins.
Like the editor's Send: a text and/or an email to the invoice's lead with the link to view it (on the sub-account's own domain when it has one), in the editor's own words unless you send message (it must include {link}). When the app already set up card payment for this invoice, the pay link rides along. Sent as the key's person, with the usual opt-out, credit and limit checks; each is billed like any text or email. A draft becomes sent; sending a sent one again is a re-send. sent lists each channel and why one didn't go. Needs a lead (PATCH lead_id) and at least one line; a paid invoice answers 409. The email carries the link, not a PDF attachment (the app's Send attaches one). Owners and admins.
The Invoices list's Mark as paid, for money taken outside the app (cash, a check, a transfer): the invoice becomes paid in full, now (on a deposit invoice, the deposit). Whatever follows a paid invoice in the app follows this too. Already paid answers 409. No body. Owners and admins.
A blank page with the usual words, or a copy of another page of the same sub-account (copy_of: its look, threshold and settings come along). The new page has its own link and stays off until someone turns it on in the app. name, copy and helper follow the rules of PATCH /v1/review-funnels/{funnel_id}: words offering something for a review or asking for a particular rating are refused. The sub-account's first page becomes its default. Owners and admins, with the Google tools add-on.
Parameter
Description
copy_of
body · string
A review page of this sub-account to copy.
name
body · string
For the team, up to 60 characters. Default "New review page", or "<name> copy".
copy
body · object
Any of headline (140), message (300), low_title (100), low_message (300), low_button (40), low_thanks (300), high_title (100), high_message (300), high_button (40).
helper
body · object
Any of enabled, question (120), chips (up to 8, 32 characters each), keywords (up to 6, 60 characters each), details, ask_photo.
Links already sent for the page open the default page from then on, and its results stay in GET /v1/review-requests. Deleting the default page makes the oldest page left the default (default_funnel_id; null when none is left). Owners and admins, with the Google tools add-on.
Sets up card payment for the invoice on the business's own connected payment processor (Settings > Integrations) and answers payment_url. Made for the invoice as it is now; an earlier unpaid page for the same invoice is cancelled, so it can't be paid twice. With authorize_net and whop the customer pays from the invoice's own page (pays_on_invoice_page true; the page opens once the invoice is sent). gateway left out: the processor the invoice already uses, else the sub-account's default, else whichever is connected with card payments on invoices switched on. Nothing is charged by this call. 409 when the invoice is paid or cancelled, has no customer email, card payment is off for it, its total is under the processor's minimum, or no processor is ready. Never answers a key or the processor's own ids. Owners and admins.
Parameter
Description
invoice_id
path · string · required
Invoice id.
gateway
body · string
Which connected processor. Default: the invoice's, else the sub-account's default.
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/invoices/INVOICE_ID/payment-link",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"invoice_id": "uuid",
"gateway": "stripe",
"payment_url": "https://invoice.stripe.com/i/acct_x/live_y",
"pays_on_invoice_page": false,
"payment_status": "open",
"paid": false,
"note": "Made for the invoice as it is now; an earlier unpaid page for it was cancelled. POST /v1/invoices/{id}/send texts or emails the invoice with this page."
},
"error": null
}
The sub-account's invoices, newest first. effective_status adds overdue (sent and past due), as the app shows it. kind is invoice, deposit (it lists the whole job but asks only for deposit_cents now; deposit_percent when it was a percent) or balance (made by Bill the balance: deposit_invoice_id is the deposit it follows and deposit_applied_cents comes off the job total). total_cents is always what this invoice asks for. Owners and admins only. Payment processor details are never returned.
Adds the customer's address, notes, terms, subtotal, discount and tax, the PDF link, line items, the event history (created, sent, viewed, paid) and public_path, the customer's view-and-pay page on the sub-account's domain (none for drafts).
With Track payments on (Settings > Integrations > Stripe), every paid Payment Link or checkout the business made in its own Stripe is recorded, matched to a lead (the link's client_reference_id = the lead id, then email, then phone), moves that lead to payment_stage_key (never backwards) and is sent to Meta as payment_meta_event. connection is the setting (null = Stripe not connected; listening = our webhook is on their Stripe account); payments are the ones recorded, newest first: lead_action is moved, already, kept (it was further along), none or no_lead; meta_status is sent, queued, failed, off, no_dataset or no_login. Owners and admins only. The Stripe key and webhook details are never returned.
on: true adds our webhook endpoint to the business's connected Stripe account (the key needs Webhook Endpoints: Write) and false removes it; payments already recorded stay. stage_key is the pipeline stage a paying lead moves to (any stage the sub-account shows except lost; null leaves the lead where it is); meta_event is what the sub-account's Meta dataset gets (Purchase with the amount, Schedule, or null for nothing). Send any of the three; the rest stay as they are. 409 when Stripe isn't connected (connect it in the app). Owners and admins only. Answers with the connection as GET /v1/stripe/payments shows it.
Parameter
Description
on
body · boolean
Track payments, or stop.
stage_key
body · string
Where a paying lead moves (GET /v1/stages), or null to leave it.
The sub-account's estimates, newest first, as the Estimates tab lists them: number, title, the customer, status and effective_status (expired: sent and past its last day), when it was sent, viewed, approved (and by whom) or declined (and why), the invoice it became, its Good / Better / Best options with their totals, and total_cents (the option the customer picked, else the recommended one). With Quote templates (Settings > Features) each also says the template it started from (template_id), what approving does (on_approve, approval_steps in words), the booking calendar (booking_calendar_id), whether the customer signed (signed; the drawing itself never leaves) and the total they agreed to with their add-ons (approved_total_cents); these are null / false otherwise. Technicians and Staff limited to their own leads see the estimates for leads they can see and ones they made without a lead, as in the app.
Parameter
Description
status
query · string
Filter.
One of: draft, sent, approved, declined, expired, converted
Adds the customer's address, intro, terms, tax rate and the customer's approval note, every option (name, description, photo, recommended, subtotal, tax and total) with its lines (name, details, photo, quantity, unit price, taxable, and with Quote templates optional (an add-on the customer may tick) and picked (they did); an option's totals count its other lines plus the picked add-ons), the history (created, sent, viewed, approved, declined) and public_path, the customer's page on the sub-account's domain (none for drafts). Also template_id, on_approve, approval_steps, booking_calendar_id, signed and approved_total_cents as the list shows them.
The saved items estimates and invoices pick their lines from: name, details, category, unit price, taxable, photo, and how often it's used (most used first).
Saved as a draft exactly as the estimate editor saves one: the sub-account's next number, its default terms, days valid and tax rate, the lead's name, email, phone and address filled in. Send items for one option, or options (2-5, e.g. Good / Better / Best) each with its items; every option's subtotal, tax and total are worked out as the editor does (each line rounded, tax on taxable lines; an add-on line counts only once the customer picks it). With Quote templates on (Settings > Features), template_id starts it from a saved quote (its title, intro, terms, days valid, options and lines, on_approve and booking calendar) and anything else you send replaces the template's (items or options replace all its lines); lines can be add-ons (optional) and on_approve says what approving does. Those fields answer 403 feature_off while Quote templates is off. Answers with the estimate as GET /v1/estimates/{estimate_id} shows it. Send it with POST /v1/estimates/{estimate_id}/send. Technicians only while the sub-account lets them make estimates, and only for their own leads.
Parameter
Description
lead_id
body · string
Who it is for (fills in the customer; needed to send it). Or customer_name.
template_id
body · string
Start from this quote template (GET /v1/estimate-templates). Needs Quote templates.
title
body · string
Max 200, e.g. Whole-house duct cleaning.
intro
body · string
A note to the customer at the top (max 2000).
items
body · array
One option's lines: [{ description (the line's name, max 300), details? (max 2000), image_url? (https), quantity? (default 1), unit_price_cents, taxable? (default true), optional? (an add-on the customer may tick, counted once picked; needs Quote templates) }]. At least one line isn't optional.
options
body · array
Instead of items, up to 5 choices: [{ name, description?, image_url?, recommended?, items: [...] }]. One is recommended (the first marked, else the first).
on_approve
body · object
What approving does: { signature (they draw their signature), invoice: "none" | "draft" (an invoice waits for you to send) | "pay" (they pay it right away), deposit_percent (above 0, below 100) or deposit_cents (a fixed amount; either needs an invoice), mark_won (the lead is marked Won with the total) }, or null for nothing automatic. Default: the template's, else nothing automatic. Needs Quote templates.
booking_calendar_id
body · string
After approving, the customer can book a time on this calendar of the sub-account (GET /v1/calendars), or null. Default: the template's. Needs Quote templates.
tax_rate
body · number
Percent, 0-30. Default: the sub-account's.
valid_days
body · number
Days it is valid (1-365). Default: the sub-account's. Or expires_at.
expires_at
body · string
Last day, YYYY-MM-DD, or null for no end.
terms
body · string
Max 4000. Default: the sub-account's estimate terms.
currency
body · string
3 letters, default usd.
customer_name
body · string
Without a lead, or to change what the lead fills in.
Send only what changes. options (or items) replace every option and line, as the editor saves; a new tax_rate re-totals the options. on_approve, booking_calendar_id and add-on lines (optional) need Quote templates on (403 feature_off otherwise); template_id is only for creating. An approved estimate or one already made into an invoice answers 409: make a new one.
Parameter
Description
estimate_id
path · string · required
Estimate id.
title
body · string
New title.
intro
body · string
New note at the top.
lead_id
body · string
Or null.
items
body · array
Replaces the options with one (lines may be optional add-ons, see create).
options
body · array
Replaces the options.
tax_rate
body · number
Percent, 0-30; re-totals the options.
valid_days
body · number
Days valid from today (1-365).
expires_at
body · string
Last day, YYYY-MM-DD, or null.
terms
body · string
New terms.
customer_name
body · string
Customer name.
customer_email
body · string
Customer email.
customer_phone
body · string
Customer phone.
customer_address
body · string
Customer address.
on_approve
body · object
What approving does: { signature (they draw their signature), invoice: "none" | "draft" (an invoice waits for you to send) | "pay" (they pay it right away), deposit_percent (above 0, below 100) or deposit_cents (a fixed amount; either needs an invoice), mark_won (the lead is marked Won with the total) }, or null for nothing automatic. Needs Quote templates.
booking_calendar_id
body · string
A calendar of the sub-account, or null. Needs Quote templates.
Like the editor's Send: a text and/or an email to the estimate's lead with the link to review and approve it (on the sub-account's own domain when it has one), in the editor's own words unless you send message (it must include {link}). Sent as the key's person, with the usual opt-out, credit and limit checks; each is billed like any text or email. A draft (or a declined or expired one) becomes sent. sent lists each channel and why one didn't go.
Convert to invoice: a draft invoice from the option the customer picked (else the recommended one, or option_id), with its lines (and the add-ons the customer picked, never the ones they left), the estimate's tax rate and the sub-account's due days, terms and notes; the estimate becomes converted. Owners and admins (invoices are theirs). Send the invoice from the app.
Saved quotes estimates start from, the most used first: name, the estimate title it fills in, shape (options, lines, add-ons), from_cents (the recommended option's lines before tax and add-ons), what approving does (on_approve, and approval_steps in words), the booking calendar, use_count and last_used_at. Everyone who makes estimates reads them. Needs Quote templates on in Settings > Features (PATCH /v1/workspaces/{workspace_id} with enabled_features.quote_templates); while it's off this answers 403 feature_off.
Adds intro, terms, valid_days and the options with every line (prices in cents; optional = an add-on the customer may tick). Needs Quote templates on in Settings > Features (PATCH /v1/workspaces/{workspace_id} with enabled_features.quote_templates); while it's off this answers 403 feature_off.
Owners and admins, at most 200 per sub-account. Without on_approve a new template asks for a signature, has the customer pay the invoice right away and marks the lead Won, as in the app. Make an estimate from it with POST /v1/estimates template_id. Needs Quote templates on in Settings > Features (PATCH /v1/workspaces/{workspace_id} with enabled_features.quote_templates); while it's off this answers 403 feature_off.
Parameter
Description
name
body · string · required
What the team sees in the list (max 120).
title
body · string
The estimate's title it fills in (max 200).
intro
body · string
A note to the customer at the top (max 2000).
terms
body · string
Max 4000. Empty: the sub-account's estimate terms.
valid_days
body · number
Days an estimate made from it is valid (1-365). Empty: the sub-account's default.
options
body · array
The options with their lines, 1-5 (replaces them all): [{ name, description?, image_url? (https), recommended?, items: [{ description (max 300), details?, image_url? (https), quantity? (default 1), unit_price_cents, taxable? (default true), optional? (an add-on the customer may tick; counts once picked) }] }]. Every option needs at least one line that isn't optional.
on_approve
body · object
What approving does: { signature (they draw their signature), invoice: "none" | "draft" (an invoice waits for you to send) | "pay" (they pay it right away), deposit_percent (above 0, below 100) or deposit_cents (a fixed amount; either needs an invoice), mark_won (the lead is marked Won with the total) }, or null for nothing automatic.
booking_calendar_id
body · string
After approving, the customer can book a time on this calendar of the sub-account (GET /v1/calendars), or null.
Owners and admins. Send only what changes; options replace them all. Estimates already made from it keep what they copied. Needs Quote templates on in Settings > Features (PATCH /v1/workspaces/{workspace_id} with enabled_features.quote_templates); while it's off this answers 403 feature_off.
Parameter
Description
template_id
path · string · required
Template id.
name
body · string
New name.
title
body · string
New title.
intro
body · string
New note at the top.
terms
body · string
New terms.
valid_days
body · number
1-365, or null.
options
body · array
Replaces the options (see create).
on_approve
body · object
What approving does: { signature (they draw their signature), invoice: "none" | "draft" (an invoice waits for you to send) | "pay" (they pay it right away), deposit_percent (above 0, below 100) or deposit_cents (a fixed amount; either needs an invoice), mark_won (the lead is marked Won with the total) }, or null for nothing automatic.
Owners and admins. Estimates made from it keep everything they copied. Needs Quote templates on in Settings > Features (PATCH /v1/workspaces/{workspace_id} with enabled_features.quote_templates); while it's off this answers 403 feature_off.
Tools → Review funnel: each review page, which one is the default, its rating threshold, where happy customers are sent, its words (copy), "Help them write it" (helper) and its public_path (/r/<code> on the sub-account's domain).
Makes (or returns) the lead's link on a review page, like Copy review link on the lead. Sends nothing; share it however you like. Owners and admins only.
The team's name for the page, what it says (public, at once) and "Help them write it": after a happy rating the customer taps what they liked and the page writes a short review for them to edit and post themselves. Send only what changes; copy and helper merge onto what's saved. The star threshold, where unhappy customers go and the thank-you offer can't be changed here, and words offering something for a review or asking for a particular rating are refused (Google's and the FTC's rules). Owners and admins, with the Google tools add-on.
Parameter
Description
funnel_id
path · string · required
Review page id (GET /v1/review-funnels).
name
body · string
For the team, up to 60 characters.
copy
body · object
Any of headline (140), message (300), low_title (100), low_message (300), low_button (40), low_thanks (300), high_title (100), high_message (300), high_button (40). {business} and {first_name} are filled in.
helper
body · object
Any of enabled, question (120), chips (up to 8, 32 characters each: what customers can tap), keywords (up to 6, 60 characters each: services and towns a review may mention once), details (the optional "Anything to add?" box), ask_photo (ask for a photo of the job; it waits for the owner's OK).
The sub-account's marketing emails, most recently changed first, as Tools > Email Marketing lists them: status (draft, scheduled, sending, sent, failed, canceled), subject, who it goes to, the pace (drip: every emails a batch, minutes between batches; null = all at once), how far it got and the results (delivered, opened, clicked, booked, booked after a click, unsubscribed, bounced). Owners and admins.
Parameter
Description
status
query · string
Filter.
One of: draft, scheduled, sending, sent, failed, canceled
Adds its content (subject, preheader, headline, sections in blocks, the button, signature, design), where the button goes (destination), problems (what still blocks sending; ready_to_send when there are none) and the header pictures' status.
With brief, the AI designs and writes the whole email from one or two sentences, as Write it for me does (it can take a minute or two), and suggests an audience (suggested_audience); pictures: true also makes AI header pictures (0.5 credits each, three a round). Without, a draft from the business's own details and the content you send. The button goes to destination (default: the newest published Smart Page, else a booking form) or button_url. Nothing is sent. Owners and admins.
Parameter
Description
name
body · string
Your name for it (max 120).
brief
body · string
What the email is about: the offer, the deadline, who it's for (4-4000 characters). Not with the content fields.
pictures
body · boolean
With brief: AI header pictures (spends credits). Default false.
destination
body · object
Where the button goes: { kind: smart_page | smart_form, id }, { kind: url, url } or { kind: none }.
subject
body · string
Max 150.
preheader
body · string
The preview line inboxes show after the subject (max 200).
eyebrow
body · string
A small label above the headline (max 40).
headline
body · string
Max 160.
greeting
body · string
e.g. Hi {first_name}, (max 80).
body
body · string
The words in markdown (## headings, - bullets, bold, [links](https://...)), max 12000. Replaces every section with one text section.
blocks
body · array
Instead of body, up to 24 sections as GET shows them: text {md}, offer {value, label, was, note, kicker}, image {url}, split {url, title, md}, features / steps {title, items}, quote {text, name, stars}, gallery {images}, banner {text}, faq {items: [{q, a}]}, cards {items}, button {label, url}, divider, html {html} (email-safe HTML), game {gameId, headline, text, button} (one of the sub-account's reward games: its picture and a play button; each reader who clicks gets their own play).
button_label
body · string
The main button (max 50).
button_url
body · string
Where it goes: a full http(s) link.
hero_image_url
body · string
An https picture at the top, or empty to remove it.
Design > Logo at the top: false leaves the logo and business name off the top of the email (when a picture or your own header already shows them); true puts them back. Works with brief too.
html
body · string
Your own HTML (a whole email, max 250,000 characters): sent as written instead of the designed email, with subject and preheader still applied. Scripts are taken out; {first_name}, {business} and {unsubscribe_link} are filled in, and without an unsubscribe link a footer with the business's address and one is added. Send an empty string to go back to the designed email.
audience
body · string
Who gets it: everyone with an email address, everyone who hasn't booked, leads in some stages, or leads with any of some tags.
One of: everyone, not_booked, stages, tags
stages
body · array
audience stages: stage keys (GET /v1/stages).
tags
body · array
audience tags: tag names or ids (GET /v1/tags).
not_booked
body · boolean
audience tags: only those who haven't booked.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/email-campaigns" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"brief": "$49 furnace tune-up through November 15, for past customers",
"design": "fresh"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/email-campaigns", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
brief: "$49 furnace tune-up through November 15, for past customers",
design: "fresh",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/email-campaigns",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"brief": "$49 furnace tune-up through November 15, for past customers",
"design": "fresh",
},
)
print(res.json())
Send only what changes, as the builder saves it; brief has the AI rewrite the whole draft instead. A campaign that was sent or scheduled answers 409: duplicate it.
Parameter
Description
campaign_id
path · string · required
Campaign id.
name
body · string
New name.
brief
body · string
The AI rewrites the draft from this (not with the content fields).
pictures
body · boolean
With brief: new AI header pictures (spends credits).
subject
body · string
Max 150.
preheader
body · string
The preview line inboxes show after the subject (max 200).
eyebrow
body · string
A small label above the headline (max 40).
headline
body · string
Max 160.
greeting
body · string
e.g. Hi {first_name}, (max 80).
body
body · string
The words in markdown (## headings, - bullets, bold, [links](https://...)), max 12000. Replaces every section with one text section.
blocks
body · array
Instead of body, up to 24 sections as GET shows them: text {md}, offer {value, label, was, note, kicker}, image {url}, split {url, title, md}, features / steps {title, items}, quote {text, name, stars}, gallery {images}, banner {text}, faq {items: [{q, a}]}, cards {items}, button {label, url}, divider, html {html} (email-safe HTML), game {gameId, headline, text, button} (one of the sub-account's reward games: its picture and a play button; each reader who clicks gets their own play).
button_label
body · string
The main button (max 50).
button_url
body · string
Where it goes: a full http(s) link.
hero_image_url
body · string
An https picture at the top, or empty to remove it.
Design > Logo at the top: false leaves the logo and business name off the top of the email (when a picture or your own header already shows them); true puts them back. Works with brief too.
html
body · string
Your own HTML (a whole email, max 250,000 characters): sent as written instead of the designed email, with subject and preheader still applied. Scripts are taken out; {first_name}, {business} and {unsubscribe_link} are filled in, and without an unsubscribe link a footer with the business's address and one is added. Send an empty string to go back to the designed email.
audience
body · string
Who gets it: everyone with an email address, everyone who hasn't booked, leads in some stages, or leads with any of some tags.
Emails real people. As the Send button: to the saved audience (or the one you send), now or at schedule_at, all at once or a few at a time (drip). Left out: leads with no email address, who unsubscribed, bounced or marked it spam. Each email costs messaging credits (none through the business's own email server); a send the credits don't cover answers 402 before anything goes out. A draft is sent once: a second call answers 409. recipients is how many it goes to.
Parameter
Description
campaign_id
path · string · required
Campaign id.
audience
body · string
Who gets it: everyone with an email address, everyone who hasn't booked, leads in some stages, or leads with any of some tags.
One of: everyone, not_booked, stages, tags
stages
body · array
audience stages: stage keys (GET /v1/stages).
tags
body · array
audience tags: tag names or ids (GET /v1/tags).
not_booked
body · boolean
audience tags: only those who haven't booked.
schedule_at
body · string
ISO 8601 with a time zone, 2 minutes to 90 days ahead. Leave out to send now.
drip
body · object
A few at a time: { every: 1-10000 emails, minutes: 5-43200 between batches }. The whole send must fit in 90 days.
Tools > Reward Games: short games (spin the wheel, scratch card, pick a gift, slot machine, pop a balloon, prize drop) a business sends past customers and old leads. Every play wins one of its own rewards, shown as a coupon, and playing is free. Each game has its setup, rewards with each one's chance and how many were won, share_url (the public link for social or a flyer) and numbers: added_by_send, sent, opened, played, redeemed, friends (came through a friend's link), friend_rewards, booked (a sale, booking or coupon used after playing) and booked_cents. Test plays never count. Owners and admins only.
A new draft, from a ready-made template or blank; anything else you send goes on top. Nothing is sent, and its links don't work until it is live. A game can never be tied to a review: wording about reviews or ratings anywhere is refused (Google's policy and the FTC rule). Rewards are 3 to 8, each with a label of up to 24 characters; a blank game can start with none but can't go live or be sent until it has them. Up to 50 games per sub-account. Answers with the game as GET shows it.
Parameter
Description
template
body · string
Start from a ready-made game. Left out: blank.
One of: win-back, tune-up, lost-quotes, refer-a-friend
name
body · string
The game's name, up to 60 characters (only your team sees it).
style
body · string
The game.
One of: wheel, scratch, gifts, slots, balloons, drop
scene
body · string
The look of the page.
One of: night, day, warm
accent
body · string
#RRGGBB, or empty for the business's own colour.
slice_colors
body · array
The wheel's slices: 2 to 4 #RRGGBB, or empty for shades of the accent.
font
body · string
Headline font.
One of: bricolage, montserrat, poppins, nunito, fredoka, oswald, playfair, fraunces
photo
body · string
A picture already stored with us (a media library link), or empty.
photo_show
body · string
How much of the photo shows.
One of: little, some, lots
headline
body · string
Up to 60 characters.
subhead
body · string
Up to 120 characters.
button
body · string
The wheel's button, up to 24 characters.
language
body · string
The language of every word on the game, its texts and its emails. Stock wording follows it; the business's own stays.
One of: en, fr, es, de, nl, pt-BR, pt, zh
words
body · object
The business's own words over the language's, by key: for example { continue: "Je tente ma chance", showButton: "Montrer en magasin", bookNow: "Prendre rendez-vous" }. Keys include the game's, the coupon's, the form's, the friend step's and the texts'; an unknown key is refused and lists them all. {braces} are filled in. "" puts a word back. The texting agreement and the rules can't be changed.
claim_how
body · string
How a reward is claimed.
One of: book, call, show
terms
body · string
The business's fine print, up to 300 characters.
expires_days
body · number
Days a won reward stays good, 1-90.
referral
body · object
{ on, reward }: the fixed reward a customer earns when a friend uses theirs (never an extra spin).
form
body · object
Questions before playing: { on, email: off | optional | required, questions: [{ label, type: text | choice | choices | yesno, options, required }] }, up to 6. Answers never change what anyone wins.
rewards
body · array
3 to 8 of { id, label, detail, weight (1-100), stock (null = no limit) }. A reward named by its id, or by the same label, keeps its won count.
message
body · string
The text sent with the link, up to 640 characters: {first_name}, {business}, {link}, {referral_reward}.
Send only what changes: the fields of POST /v1/reward-games, and status. status draft | live | paused | ended is the game's switch: live makes its links work (409 until it has 3 rewards in stock), paused shows a back-soon page and holds its queue, ended closes it. New plays get the changes. Reward won counts and the public link are the server's and can't be changed. Wording about reviews is refused.
Free, and sends nothing. count = who would get it; skipped = people left out (no number or email, opted out, already have this game). at_least: the sub-account is too big to count exactly. per_send: how many one send queues at most.
Parameter
Description
game_id
path · string · required
Game id.
audience
body · string · required
Who.
One of: past_customers, lost_quotes, quiet_leads, everyone
Messages real people. Puts each person (up to 2,000 a send) in the queue with their own time, at the pace you ask or the recommended one (texts: half the daily texting limit a day; emails: 100 an hour), inside the business's sending hours and never past its daily limit, so a list is never sent all at once. Quiet hours, STOP and do-not-text apply. Each person gets a personal link once per game. A draft goes live. 409 when the game is paused or ended, has too few rewards or mentions reviews. more_not_sent: people past the 2,000; send again later to reach them.
Parameter
Description
game_id
path · string · required
Game id.
audience
body · string · required
Who.
One of: past_customers, lost_quotes, quiet_leads, everyone
channel
body · string · required
How it goes.
One of: sms, email
tag_ids
body · array
Only leads with any of these tags (GET /v1/tags).
pace
body · object
{ n, per: hour | day }: at most 500 an hour or 5,000 a day. Left out: the recommended pace.
Newest first. status is queued, sent, opened, played, redeemed, failed or skipped; kind is play, or bonus for a referrer's fixed reward; not_sent_reason says why one didn't go; answers are the game's questions. q finds a coupon code or a first name, then POST .../plays/{play_id}/redeem marks it used.
Parameter
Description
game_id
path · string · required
Game id.
filter
query · string
Default all. won = played and not used yet; waiting = queued, sent or opened; friends = came through a friend, and their rewards.
The customer used their coupon. Notes it on the lead; when this player came through a friend, the friend gets the game's fixed referral reward by text (friend_reward). Past its date it is redeemed anyway and says expired: the business decides. undo: true marks it not used; a referral reward already given stays. 409 when they haven't played.
What the link editor starts from: saved UTM sets, saved pixel ids, the domain new links start on (null is the usual address) and the look new QR codes start from. Owners and admins.
Only what's sent changes; each part sent replaces that part. A value that isn't allowed is refused with what is. Links already made keep their own UTM, pixels and QR look. Owners and admins.
Parameter
Description
default_domain
body · string
One of the sub-account's short domains (GET /v1/short-links/domains), or null for the usual address.
utm_templates
body · array
Up to 40 saved sets: name (60) and any of utm_source, utm_medium, utm_campaign, utm_term, utm_content (200 each).
pixels
body · object
Saved pixel ids: meta (10-20 digits), google (G-XXXXXXX or AW-123456789), tiktok (the pixel id), linkedin (the partner id). null or "" removes one.
qr
body · object
The look new QR codes start from: fg, bg, eye, frameColor (#rrggbb; eye "" follows the dots), dots (square, rounded, dots, fluid), corners (square, rounded, circle), logo, logoUrl (https), frame (none, label, bubble, card), frameText (28), transparent. Fields left out go back to the usual look.
The sub-account's short links, newest first, with clicks and QR scans. A link without a domain lives at <CRM domain>/l/<key>; one on the business's own domain at https://<domain>/<key> (short_url has it). state: active, scheduled_end (it has an end date or click limit), expired, used_up or disabled. Free: short links never cost credits.
Parameter
Description
q
query · string
Words in the name, address or back-half.
tag
query · string
Only links with this tag.
domain
query · string
Only links on this domain (empty = the CRM's own address).
url is where people land (https:// is added when left out). Leave key out for a random back-half; a taken key is 409. The page's title becomes the link's name unless you send one. Everything else is optional and can be changed later, including url: printed QR codes keep working. qr_image in the answer is the QR code (SVG) in the link's design; add ?qr=1 to the short link yourself to count scans apart from clicks.
Parameter
Description
url
body · string · required
Where people land.
key
body · string
The back-half: letters, numbers, - and _, up to 50. slug works too.
domain
body · string
One of GET /v1/short-links/domains (verified). Left out: the sub-account's default.
title
body · string
A name only the team sees.
tags
body · array
Up to 20.
utm
body · object
{ source, medium, campaign, term, content }: added to url.
expires_at
body · string
When it stops (ISO date). Then people go to expired_url, else a page saying it ended.
expired_url
body · string
Where people go once it ends.
click_limit
body · number
Stops after this many clicks.
password
body · string
People type it before they go on. Kept only as a hash.
ios_url
body · string
Where iPhones and iPads go: a web address, or an app link (instagram://user?username=you) that opens the app, with url as the fallback.
android_url
body · string
Where Android phones go; an app link works the same way.
geo
body · object
{ "CA": "https://..." }: a country's visitors go to its own page (up to 30).
variants
body · array
A/B split: [{ url, weight }] (1-3, weights in percent; the main url keeps the rest).
og
body · object
The card texts and posts show: { title, description, image }.
pixels
body · object
{ meta, google, tiktok, linkedin }: retargeting pixels fired on the way through.
cloak
body · boolean
Show the page under the short address, so the short link stays in the address bar (sites that refuse frames get an Open button).
links is a list of addresses or { url, key?, title?, tags?, ... } (any field of POST /v1/short-links); defaults applies to every one (tags, utm, domain...). Each is made on its own: results says which worked, in order.
Clicks for all the sub-account's links (or one tag's): totals against the same length of time before (previous), a series by hour (up to 2 days) or day in the business's time zone, breakdown by country, region, city, continent, device, browser, os, referrer, trigger (link or qr), target (which page a rule sent them to), hour and weekday, and the top links. people counts different visitors (a salted fingerprint of IP and browser, never shown) and returning those who came back; visitors counts different people each day. breakdown also has postal (ZIP), model (phone), os_version, browser_version, isp (network), language, referrer_url (the page they came from) and query (the link's own ?parameters), and points are map positions (city level). Bots and link previews are recorded apart (totals.bots) and never counted.
Parameter
Description
range
query · string
Default 30d.
One of: 24h, 7d, 30d, 90d, 12mo
from
query · string
Or a start (ISO date)...
to
query · string
...and an end (default now). Up to 3 years.
tz
query · string
IANA time zone for the series (default the sub-account's).
tag
query · string
Only links with this tag.
country
query · string
Filter: only clicks from this country (any breakdown key works the same way: region, city, postal, continent, device, browser, os, model, referrer, trigger, target, isp, language, query).
Opens every link's destination (or the ids sent, up to 300) and keeps the answer on the link (health: ok, status, checked_at): a page that stopped working shows as broken in the app. Free.
Send only what changes: any field of POST /v1/short-links, plus pinned and archived (an archived link still works). Changing url sends everyone, printed QR codes included, to the new page. Changing key or domain makes a new address: the old one stops working. password "" removes the password; utm alone re-tags the current url; null clears expires_at, expired_url, click_limit, ios_url, android_url or og.
Parameter
Description
link_id
path · string · required
Link id.
archived
body · boolean
Hide it from the list; it keeps working.
pinned
body · boolean
Keep it at the top.
url
body · string
Where people land.
key
body · string
The back-half: letters, numbers, - and _, up to 50. slug works too.
domain
body · string
One of GET /v1/short-links/domains (verified). Left out: the sub-account's default.
title
body · string
A name only the team sees.
tags
body · array
Up to 20.
utm
body · object
{ source, medium, campaign, term, content }: added to url.
expires_at
body · string
When it stops (ISO date). Then people go to expired_url, else a page saying it ended.
expired_url
body · string
Where people go once it ends.
click_limit
body · number
Stops after this many clicks.
password
body · string
People type it before they go on. Kept only as a hash.
ios_url
body · string
Where iPhones and iPads go: a web address, or an app link (instagram://user?username=you) that opens the app, with url as the fallback.
android_url
body · string
Where Android phones go; an app link works the same way.
geo
body · object
{ "CA": "https://..." }: a country's visitors go to its own page (up to 30).
variants
body · array
A/B split: [{ url, weight }] (1-3, weights in percent; the main url keeps the rest).
og
body · object
The card texts and posts show: { title, description, image }.
pixels
body · object
{ meta, google, tiktok, linkedin }: retargeting pixels fired on the way through.
cloak
body · boolean
Show the page under the short address, so the short link stays in the address bar (sites that refuse frames get an Open button).
The link, its QR code and its numbers are gone for good; anyone who opens it sees "link not found". To keep it working but out of the list, PATCH archived: true instead.
Newest first: when, QR scan or click, which page it went to, country, region, city, ZIP, map position, time zone, device and phone model, browser and OS with versions, language, the site and page they came from, the link's own ?parameters, the IP address (kept 90 days), network (ISP, ASN) and whether they came back. Robots are left out.
Domains like go.yourbusiness.com that short links can use. verified: it's live. dns_record is what to add at the domain's DNS provider. root_url: where the bare domain goes; not_found_url: where an unknown back-half goes.
Adds the domain and checks it at once. Point a CNAME record for it to portal.usezu.com (a bare domain: an ALIAS or ANAME record); it is checked every few minutes until it's live, usually 5-30 minutes. Use a subdomain (go., link.), never the address of the main website. Up to 10.
Every page of the website with its views per device
GET/v1/website-analytics/pages
Read only
The pages visitors opened in the last days, most viewed first (up to 200): host, path, title, views, and views on desktop, tablet and mobile. pictures lists the devices a page has a picture for in the app's heatmaps. Use a path with GET /v1/website-analytics/heatmap. Owners and admins.
Parameter
Description
site_id
query · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
days
query · number
How many days back, 1-400 (default 30).
host
query · string
Only this website (a host name like www.example.com), when the code is on several.
One page on one device: what people click and how far they scroll
GET/v1/website-analytics/heatmap
Read only
A page's heatmap numbers: views, visitors, avg_s (attention time), exit_rate, clicks_total, elements (the 60 most clicked: its CSS path, label, tag, link, clicks, sessions, rage clicks and dead clicks), reach (percent of views that got to each 5 % of the page, 0 % to 100 %), fold (how much of the page shows without scrolling, percent), page_height, attention (average attention in each twentieth of the page, top to bottom) and devices (views per device). The page's picture and every single click's position stay in the app; has_picture says whether the app has one. Owners and admins.
Parameter
Description
site_id
query · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
path
query · string · required
The page's path, e.g. /pricing (from GET /v1/website-analytics/pages).
The visits that were recorded, as the app's Recordings list: when, entry and exit page, pages, attention time (engaged_ms), length of the recording (duration_ms), source, channel, ad platform, campaign, place, device, browser, clicks, rage and dead clicks, errors, quick_backs, conversions, starred, summary (the AI's one line, when someone asked for it), score (the app's 'worth watching' number: frustration, conversions, time and pages) and the lead it became (lead_id, lead_name). sort best (default) | newest | longest. Filters: frustrated, converted, lead, starred, from_ads (true / false), min_s, visitor (New | Returning), and the overview's breakdowns (page, source, channel, campaign, ad, referrer, country, region, city, device, browser, os, entry, exit, host). The recording itself plays only in the app; visitor ids are never returned. Owners and admins.
Parameter
Description
site_id
query · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
days
query · number
How many days back, 1-400 (default 30).
sort
query · string
best (default), newest or longest.
limit
query · number
1-200 (default 50).
offset
query · number
Skip this many.
frustrated
query · boolean
Only visits with rage clicks, dead clicks, errors or quick backs.
converted
query · boolean
Only visits that converted (false: that didn't).
lead
query · boolean
Only visits that became a lead.
starred
query · boolean
Only starred ones.
min_s
query · number
At least this many seconds of attention.
page
query · string
Only visits that opened this page path.
device
query · string
Desktop, Mobile or Tablet.
source
query · string
Only this source (as the overview's dims.source names it).
What the app's player shows beside the video: recording (source, campaign and ad ids, referring site, place, device, screen, language, counts, starred, summary, duration_ms), lead (the lead this visit became), pages (each page in order with its time, scroll depth and the thank-you page it matched), markers (up to 1,500: clicks with the element's label, rage and dead clicks, form starts, fields touched (names only, never what was typed) and sends, errors, conversions) and other_visits (the same visitor's other visits). The video itself and its files are only in the app. Owners and admins.
Parameter
Description
recording_id
path · string · required
A recorded visit (GET /v1/website-analytics/recordings).
The website's forms: started, sent, and where people stop
GET/v1/website-analytics/forms
Read only
Each form on the website (by page and form name): visits that started it, visits that sent it, and its fields in order with touched, filled and quit_here (people whose last field this was before leaving without sending). Field names only, never what anyone typed. Takes the overview's filters (device, source, campaign, country, page...). Owners and admins.
Parameter
Description
site_id
query · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
A funnel over the last days: 2 to 6 steps, each a page ({ type: 'page', value: '/pricing', match: 'exact' | 'starts' | 'contains' }, exact by default) or a conversion ({ type: 'convert', value: 'Form sent' }; value '' counts any conversion). Answers the visits that reached each step after the one before it. filter narrows the visits like the overview's filters ({ device: 'Mobile' }). Only reads: nothing is saved. Owners and admins.
Parameter
Description
site_id
body · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
steps
body · array · required
2-6 steps in order: { type, value, match? }.
days
body · number
How many days back, 1-400 (default 30).
filter
body · object
Narrow the visits, e.g. { device: 'Mobile', source: 'Meta Ads' }.
Visits active in the last 5 minutes (up to 50), newest first: the page they're on, source, country, city, device, pages so far and whether the visit is being recorded. Owners and admins.
Parameter
Description
site_id
query · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
record (visits are recorded), record_rate (percent of visits recorded), mask_text (every word shown as stars in recordings and heatmaps), hosts (only these websites count; empty = any site the code is on), blocked_hosts (websites whose visits are dropped), goals (thank-you pages: a visit that reaches one counts as converted), installed, last_seen_at, last_host and recordings_this_month. The code itself is GET /v1/website-analytics/install. Owners and admins.
Parameter
Description
site_id
query · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
Send only what changes. record true / false; record_rate 100, 50, 25 or 10; mask_text; hosts and blocked_hosts (host names like www.example.com, up to 50 each; each list is replaced); goals (up to 20 thank-you pages, the whole list is replaced: name up to 60 characters, path starting with /, match exact | starts | contains). Typed text, passwords and card numbers are always hidden in recordings whatever is set here. Owners and admins.
Parameter
Description
site_id
body · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
record
body · boolean
Record visits.
record_rate
body · number
Percent of visits recorded: 100, 50, 25 or 10.
mask_text
body · boolean
Show every word as stars.
hosts
body · array
Only these websites count ([] = any).
blocked_hosts
body · array
Websites whose visits are dropped.
goals
body · array
Thank-you pages: { name, path, match }. Replaces the list.
The website's numbers: visitors, sources and ads, pages, conversions, frustration
GET/v1/website-analytics
Read only
From the line of code on the sub-account's website (GET /v1/website-analytics/install). people only: robots, Meta's ad checkers and the team's own browsers are left out. totals and previous (the same length before) hold visitors, sessions (visits), pageviews, avg_s (real attention time per visit), bounce_rate (one page, under 10 seconds, nothing done), converted / conv_rate (form sent, phone or email tapped, a thank-you page reached, or the site's own zs('convert')), from_ads, rage, dead, errors, quick_backs, forms_started / forms_sent. series is one row per day (per hour for 2 days or less); dims has source, channel, campaign, utm_*, ad, referrer, country, region, city, device, browser, os, screen, language, entry, exit and visitor (new or returning), each row with visitors, sessions, bounce, avg_s and conv (percent). pages, conversions, frustration (elements with rage and dead clicks), errors, hours (weekday, hour, visits), points (map), live (people in the last 5 minutes). Heatmaps and recordings are in the app. Owners and admins.
Parameter
Description
site_id
query · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
days
query · number
How many days back, 1-400 (default 30).
page
query · string
Only visits that opened this page path.
source
query · string
Only this source (as dims.source names it, e.g. Meta Ads).
The line of code for the website, and whether visits arrive
GET/v1/website-analytics/install
Read only
snippet goes inside the <head> of every page (WordPress, Wix, Squarespace, Shopify, Webflow, GoHighLevel and Google Tag Manager steps in steps). It loads after the page and hides everything typed. installed turns true with the first visit.
Parameter
Description
site_id
query · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
The sub-account's sites: each website and landing page it tracks
GET/v1/website-analytics/sites
Read only
A sub-account can track several websites and landing pages, each with its own code and its own numbers, heatmaps and recordings, kept apart. sites lists them, the first one first: id (send it as site_id on any /v1/website-analytics route), name, kind (website or landing), url, first, installed (visits arrive), last_seen_at, last_host, visitors_7d, on_it_now, recordings, smart_page_ids (Smart Pages that send their visits to it with no code) and snippet (its own line of code). Opening the tool makes the first site. Owners and admins.
Add a website or landing page with its own code and numbers
POST/v1/website-analytics/sites
Read and writeIdempotent
Makes another site for the sub-account (up to 25): its own line of code (snippet), and from the first visit its own visitors, heatmaps, recordings and Ask AI, apart from the other sites. name is what the switcher shows (unique in the sub-account, up to 60 characters). kind is website (default) or landing. smart_page_ids makes it count those Smart Pages, with nothing to paste (a page belongs to one site: it leaves the site it was on). Deleting a site is done in the app. Owners and admins.
Answered from the website's own numbers for the last days (visitors, pages, sources and ads, forms, what people click, frustration), with the numbers behind it, up to three actions (open a page's heatmap, watch recordings with a filter, narrow the overview), up to three prompts ready to paste into a website builder's AI or send to a web designer (title, for, text) and followups (likely next questions). Each answer belongs to a saved conversation (chat_id, title; the same chats as the app's Ask AI): send chat_id back and it remembers the earlier questions and answers. Free; 100 questions a week per sub-account (429 when used up, left = what's left this week). Owners and admins.
Parameter
Description
site_id
body · string
One site of the sub-account (GET /v1/website-analytics/sites). Leave out for every site together.
question
body · string · required
e.g. Which page works best, and why?
chat_id
body · string
Continue an earlier conversation (an answer's chat_id). Leave out to start a new one.
days
body · number
How many days back, 1-400 (default 30).
timezone
body · string
IANA zone (default UTC).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/website-analytics/ask" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"question": "Where do people get stuck on my website?",
"days": 30
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/website-analytics/ask", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
question: "Where do people get stuck on my website?",
days: 30,
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/website-analytics/ask",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"question": "Where do people get stuck on my website?",
"days": 30,
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"chat_id": "uuid",
"title": "Where do people get stuck on my website?",
"answer": "Most people who start your quote form stop at **Phone number** (7 of 22)...",
"actions": [
{
"type": "heatmap",
"page": "/contact",
"device": "Mobile",
"label": "See the form page on phones"
}
],
"prompts": [
{
"title": "Make the phone field optional",
"for": "AI website builder",
"text": "You are editing my website acme.com. On the page acme.com/contact ..."
}
],
"followups": [
"Is it the same on computers?",
"Write a prompt for my web designer"
],
"left": 99
},
"error": null
}
Deletes a file from the sub-account's Media page, as the page's delete does: the row, and its file only when it was uploaded into Media itself (files_removed; a tool result saved into Media points at the original ad's file, which stays). It cannot be undone. Owners and agency admins delete any file; a client admin only files they added themselves (403); other roles can't; a file that isn't shared with the client's team is a 404 to them.
A sub-account's Media page: its images and videos, newest first. Owners and agency admins see everything; the client's own people see only files shared with them (visible_to_client).
Copies a public https link into the sub-account's Media, stored like an upload: PNG, JPG, WebP or GIF up to 15 MB, MP4, MOV or WebM up to 50 MB (the file's own bytes decide its type). Larger files go through the Media page. Owners and admins; a client admin's file is always shared with the client's team, an agency's starts hidden.
Parameter
Description
url
body · string · required
A public https link to the image or video.
name
body · string
Up to 120 characters. Default: the link's file name.
An AI chat assistant (mode assistant, with a goal) or a booking widget that opens a Smart Form (mode booking, which needs smart_form_id). It starts as a new one does in the app: named "Website chat" or "Book online", the goal's quick replies, a chat bubble on the right with a teaser line, turned on. Any field of PATCH /v1/website-widgets/{widget_id} can be sent too. The answer carries install.snippet, the line to paste on the site; the widget's key is made for you. Owners and admins.
Parameter
Description
name
body · string
For the team, up to 120 characters.
mode
body · string
Default assistant.
One of: assistant, booking
goal
body · string
What the assistant works toward. Default book_appointment.
One of: book_appointment, customer_support, lead_capture
smart_form_id
body · string
The form a booking widget opens (GET /v1/smart-forms).
calendar_id
body · string
The calendar it books into; left out is the default one.
greeting
body · string
The first message, up to 500 characters.
quick_replies
body · array
Up to 4 one-tap starters, up to 80 characters each.
theme
body · object
The look, laid over the starting one: primary_color, position, launcher, teaser_text, title, subtitle and the rest of the widget's theme.
Tools > Website Widget: each chat or booking widget's settings and numbers, and install.snippet, the exact line to paste on the business's site, on the sub-account's CRM domain. Make one with POST /v1/website-widgets and remove one with DELETE /v1/website-widgets/{widget_id}.
Send what changes; the live widget follows on its next page load. theme merges over the saved look, and null clears one of its fields. Owners and admins.
Parameter
Description
widget_id
path · string · required
The widget.
name
body · string
Up to 120 characters.
enabled
body · boolean
Whether it shows on the site.
mode
body · string
An AI assistant, or a Smart Form to book (needs smart_form_id).
One of: assistant, booking
goal
body · string
What the assistant works toward.
One of: book_appointment, customer_support, lead_capture
ai_prompt
body · string
Its own prompt; null uses the sub-account's text message prompt.
agent_name
body · string
Shown under replies; null uses the texting agent's name.
greeting
body · string
The first message, up to 500 characters.
quick_replies
body · array
Up to 4 one-tap starters, up to 80 characters each.
collect_contact
body · string
Ask for details before the first message, or during the chat.
One of: before, during
notify_on_handoff
body · boolean
Tell the team when the assistant can't answer.
calendar_id
body · string
The calendar it books into; null is the default one.
A new template in the sub-account's Contracts (Tools > Contracts > Templates), ready for POST /v1/contracts. Send the text as body_html (HTML) or body (plain text with markdown: # headings, - or 1. lists, bold, *italic*). Write {{client_name}}, {{price}}, {{start_date}} and the like where a value goes: each becomes a blank (variables / blanks in the answer) filled when a contract is made. HTML is cleaned before it is saved, to exactly what the signing page shows: headings, paragraphs, lists, tables, bold / italic / underline, links (https, mailto, tel), https pictures, drawn-signature SVG paths and simple inline styles (alignment, colors, margins, fonts) stay; scripts, styles, forms, frames, event handlers and javascript: or data: links are removed, and unknown tags keep only their words. The answer's body_html is what was saved. Up to 200,000 characters. Optional step after signing: booking_enabled with booking_calendar_id (one of the sub-account's calendars), booking_heading, booking_message. Any member of the sub-account, as on the Contracts page.
Parameter
Description
name
body · string · required
The template's name, up to 160 characters.
body_html
body · string
The contract's text as HTML (cleaned before saving). Or body.
body
body · string
The contract's text as plain text with markdown. Or body_html.
description
body · string
What it is for, up to 500 characters.
category
body · string
A label to group templates by, up to 60 characters.
booking_enabled
body · boolean
After signing, offer a calendar to book on. Needs booking_calendar_id.
booking_calendar_id
body · string
The calendar to book on (GET /v1/calendars).
booking_heading
body · string
Heading over the calendar, up to 120 characters.
booking_message
body · string
A line under it, up to 600 characters.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/contract-templates" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"name": "Roofing agreement",
"category": "Roofing",
"body": "# Roofing agreement\n\nThis agreement is between {{business_name}} and {{client_name}}.\n\n## Scope\n\n- Replace the roof at {{client_address}}\n- Start on {{start_date}}\n\n## Price\n\n**{{price}}**, half due before work starts."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/contract-templates", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
name: "Roofing agreement",
category: "Roofing",
body: "# Roofing agreement\n\nThis agreement is between {{business_name}} and {{client_name}}.\n\n## Scope\n\n- Replace the roof at {{client_address}}\n- Start on {{start_date}}\n\n## Price\n\n**{{price}}**, half due before work starts.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/contract-templates",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"name": "Roofing agreement",
"category": "Roofing",
"body": "# Roofing agreement\n\nThis agreement is between {{business_name}} and {{client_name}}.\n\n## Scope\n\n- Replace the roof at {{client_address}}\n- Start on {{start_date}}\n\n## Price\n\n**{{price}}**, half due before work starts.",
},
)
print(res.json())
The template with its text (body_html), its {{blanks}} and its booking step. Only the sub-account's own templates: the agency's are not reachable here. Any member of the sub-account.
Changes only what is sent: name, description, category, the text (body_html or body, cleaned like on create; the blanks are worked out again) or the booking step (send booking_enabled with it; booking_enabled false turns it off). Contracts already made from the template keep their own text. Any member of the sub-account.
Parameter
Description
template_id
path · string · required
Template id.
name
body · string
Up to 160 characters.
body_html
body · string
The new text as HTML. Or body.
body
body · string
The new text as plain text with markdown. Or body_html.
description
body · string
Up to 500 characters; null clears it.
category
body · string
Up to 60 characters; null clears it.
booking_enabled
body · boolean
The booking step on or off; send it with any booking field.
The sub-account's contracts, newest first: who signs (lead and recipient), status (draft, sent, signed, declined, voided) and stage as the page shows it (draft, sent, viewed, signed, completed when you countersigned, declined, voided, expired), when it was sent, opened, signed or declined (and why), the onboarding call it booked, and sign_url once it is out of draft.
Adds its text (body_html), the values filled in, the {{blanks}} left and its history (created, sent, resent with the channels, viewed, signed, declined, voided).
The sub-account's templates with their {{blanks}}. Most fill in by themselves on a new contract (client_name, client_email, client_phone, client_address, business_name, date); send values for the rest.
Saved as a draft, as New contract saves one. From a template (template_id, with values for its blanks; the template's onboarding call setting comes along) or from your own text (body in markdown: # headings, paragraphs, - lists, bold, at least 40 characters). The lead's name, email, phone and address, the business's name and today's date fill in by themselves; recipient_* are for a contract without a lead. Nothing is sent: share it with POST /v1/contracts/{contract_id}/link or send it with /send (which needs a lead).
Parameter
Description
lead_id
body · string
Who signs.
template_id
body · string
From this template (GET /v1/contract-templates). Or body.
values
body · object
{ blank: value } for the template's {{blanks}} (up to 2000 characters each).
body
body · string
Instead of a template: the contract's text in markdown (max 60000).
subject
body · string
The title (max 200). Default: the template's name, or the text's first line.
recipient_name
body · string
Without a lead.
recipient_email
body · string
Without a lead.
recipient_phone
body · string
Without a lead.
expires_in_days
body · number
The signing link stops working after this many days (1-365). Default: never.
As Copy link: the link to share yourself, with nothing emailed or texted. A draft's link doesn't open, so a draft comes out of draft first (status sent). A voided contract answers 409.
Parameter
Description
contract_id
path · string · required
Contract id.
allow_blanks
body · boolean
Let it go out with {{blanks}} left for the signer to fill on the signing page. Default false: 409 with the blanks.
Emails and / or texts the contract's lead the signing link (in the business's name, from its own email and number, as the key's person; billed like any text or email; opted-out leads aren't sent to), and the message shows in the lead's conversation. A draft or declined contract becomes sent; sending again re-sends the same link. sent_via lists what went, failures why a channel didn't. Signed or voided contracts answer 409; one with no lead too.
Parameter
Description
contract_id
path · string · required
Contract id.
channel
body · string
Default email.
One of: email, sms, both
note
body · string
A short note with the link (max 1000).
allow_blanks
body · boolean
Let it go out with {{blanks}} left for the signer to fill on the signing page. Default false: 409 with the blanks.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/contracts/CONTRACT_ID/send" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"channel": "both",
"note": "Here'\''s the agreement we talked about."
}'
Newest first: your agency's own proposals (leave workspace_id out), or a sub-account's. Who each is for, status (draft, sent, accepted, declined) and stage as the page shows it (draft, sent, viewed, accepted, declined, expired), when it was sent and opened, the package and add-ons the client said yes to (accepted_choice) and the contract that made, whether the AI is working on it (ai_status building or editing), public_url once it is out of draft, and page: where it opens in the app. template=true lists your templates instead. Credits spent (credits_used) only on your agency's own.
Adds what it says: its sections in order (type and heading; a custom section's layout and HTML length), its words as plain text, the pricing (packages, add-ons, and whether the client picks one), the [blanks] the AI left for what it didn't know, the {{variables}} it uses and the ones it has nothing to fill with, its pictures (ready, being made, failed), the brief it was written from, the AI's last turn (working with its progress, or done with its reply and the changes it made) and its history (sent with how, viewed, accepted with the choice, declined). include=doc adds the whole document (theme, Brand CSS, every section with its custom HTML) and its rev, to change it with PATCH.
Parameter
Description
proposal_id
path · string · required
Proposal id.
include
query · string
doc: the whole document as well (theme, css, sections).
Create a proposal (the AI writes it, or your own HTML)
POST/v1/proposals
Read and writeUses creditsIdempotent
As New proposal, one of three ways. build: the AI writes and designs the whole proposal from your brief and prices, as Build with AI does, and makes its pictures (images, 0-24); it answers 201 at once with ai.message_id while the AI works for a minute or two: read the proposal until ai_status is idle. It never invents results, testimonials, clients or prices: what it doesn't know is left as [blanks]. template_id: a copy of one of your templates (GET /v1/proposals?template=true) for the client you name: a template that uses {{variables}} is filled in, any other is rewritten by the AI (rewrite: true or false decides). doc: your own design, no AI and no credits: { theme, css, sections }, where a custom section is your HTML and CSS (layout fullWidth or contained), css is the Brand CSS every custom section shares, and built-in sections (pricing for the packages they pick from) can sit beside them; as_template: true saves it straight as a template. The answer lists warnings for anything the page leaves out (no scripts, forms or iframes; https pictures; CSS that loads only Google Fonts and https files). Rules and an example: GET /v1/proposals/design-guide. AI work spends credits: about 1.5-3.5 for the writing plus 0.5 a picture, a change about 0.3-1.5 (in a sub-account, at its own price for Proposals, often included); 402 when they don't cover it (nothing is made). The next step after the client's "I agree": contract_template_id (the contract to sign), then signup_link_id (your agency's onboarding) or booking_calendar_id (a sub-account's booking page). Nothing is sent.
Parameter
Description
build
body · object
The AI writes it: { brief (what you're proposing, who it's for, 10-8000 characters), pricing (your packages and prices in your words, max 3000), images (AI pictures 0-24, default 4), preset (auto = your brand colours, or a look: executive, editorial, mono, emerald, electric, sunset, ocean, blush, slate, noir, citrus, atelier) }. Or template_id.
template_id
body · string
Instead of build: a copy of this template.
rewrite
body · boolean
With template_id: the AI rewrites the copy for the client named. Default true, or false when the template uses {{variables}} (they fill in).
doc
body · object
Instead of build: your own design, no AI. { theme: { headingFont, bodyFont, colors: { bg, surface, ink, muted, primary, accent }, radius, texture, numbered }, css: your Brand CSS (shared by every custom section, max 60,000), sections: [{ type: "custom", layout: "fullWidth" | "contained", html (max 100,000), css (max 50,000) }, or any built-in section: cover, letter, cards, feature, scope, timeline, stats, case_study, pricing, team, testimonial, faq, gallery, text, cta] } (1-40 sections). See GET /v1/proposals/design-guide.
as_template
body · boolean
With doc: save it as a template (no client). Make proposals from it with template_id.
title
body · string
Your name for it (max 200). Default: Proposal for <company or name>.
lead_id
body · string
A sub-account's lead it is for: fills in the client's name, email and phone, and its answer lands on the lead's timeline.
client_name
body · string
The client's name (max 200).
client_company
body · string
Their company (max 200).
client_email
body · string
Where it is emailed.
client_phone
body · string
Their phone.
client_website
body · string
Their website: a build reads it for context (it never quotes it word for word).
contract_template_id
body · string
After I agree: this contract to sign (one of the same account's contract templates).
signup_link_id
body · string
Agency proposals: after I agree (and the contract), this signup link (GET /v1/signup-links).
booking_calendar_id
body · string
A sub-account's proposals: after I agree (and the contract), this booking page (GET /v1/calendars).
accept_label
body · string
The accept button's words (max 60). Default I agree.
expires_in_days
body · number
The offer ends after this many days (1-365): the page still opens, but it can no longer be accepted.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/proposals" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"client_company": "Acme Dental",
"client_name": "Dana Lee",
"client_email": "dana@acmedental.com",
"build": {
"brief": "Local SEO and Google Ads for a two-location dental clinic that wants more implant patients",
"pricing": "Growth $1,500/month, Scale $2,800/month; setup $500 once",
"images": 4
},
"contract_template_id": "uuid"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/proposals", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
client_company: "Acme Dental",
client_name: "Dana Lee",
client_email: "dana@acmedental.com",
build: {
brief: "Local SEO and Google Ads for a two-location dental clinic that wants more implant patients",
pricing: "Growth $1,500/month, Scale $2,800/month; setup $500 once",
images: 4,
},
contract_template_id: "uuid",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/proposals",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"client_company": "Acme Dental",
"client_name": "Dana Lee",
"client_email": "dana@acmedental.com",
"build": {
"brief": "Local SEO and Google Ads for a two-location dental clinic that wants more implant patients",
"pricing": "Growth $1,500/month, Scale $2,800/month; setup $500 once",
"images": 4,
},
"contract_template_id": "uuid",
},
)
print(res.json())
Your own changes, saved at once with no AI and no credits (an editor open on it picks them up). doc replaces the whole document; or theme (merged into the current one), css (the Brand CSS; "" removes it), sections (the whole list) and ops: changes by section id (GET /v1/proposals/{proposal_id} lists them), { op: "update", id, set: { html, css, heading, ... } }, { op: "replace", id, section }, { op: "add", after: id | "start", section }, { op: "remove", id }, { op: "move", id, after }, { op: "theme", set }, { op: "css", css }. Also its name, the client (not on a template), the button's words, the end date and the next step. The answer lists the changes made and warnings for anything the page leaves out. An accepted proposal answers 409 (duplicate it), as does one the AI is working on, or one changed meanwhile.
Parameter
Description
proposal_id
path · string · required
Proposal id.
title
body · string
Its name (max 200).
doc
body · object
The whole document: { theme, css, sections } (as in POST /v1/proposals).
theme
body · object
Theme fields to change.
css
body · string
The Brand CSS every custom section shares. "" removes it.
sections
body · array
The whole list of sections.
ops
body · array
Changes by section id (up to 60): update, replace, add, remove, move, theme, css.
client_name
body · string
The client's name (max 200).
client_company
body · string
Their company (max 200).
client_email
body · string
Where it is emailed.
client_phone
body · string
Their phone.
client_website
body · string
Their website: a build reads it for context (it never quotes it word for word).
accept_label
body · string
The accept button's words (max 60); null for I agree.
expires_in_days
body · number
The offer ends this many days from now (1-365); null for no end.
contract_template_id
body · string
After I agree: this contract to sign; null for none.
signup_link_id
body · string
Agency proposals: after I agree, this signup link; null for none.
booking_calendar_id
body · string
A sub-account's proposals: after I agree, this booking page; null for none.
The rules for a proposal in your own HTML and CSS, as markdown an AI can read before it designs one: the document's parts, custom sections and the Brand CSS, what HTML and CSS are drawn (no JavaScript; https pictures; Google Fonts), the theme's CSS variables, the {{variables}}, pricing and the I agree block, templates, and an example.
import os
import requests
res = requests.get(
"https://api.localflywheel.com/v1/proposals/design-guide",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"guide": "# Proposals in your own HTML and CSS\n\nA proposal is a document: { theme, css, sections } ...",
"format": "markdown"
},
"error": null
}
One change from the editor's AI Designer, in your words: "make the pricing a table", "add an FAQ about contracts", "shorter, and warmer". Answers at once with ai.message_id while the AI works; read the proposal for its reply and the changes it made. Spends credits; an accepted proposal answers 409 (duplicate it), as does one the AI is still working on.
Parameter
Description
proposal_id
path · string · required
Proposal id.
instruction
body · string · required
What to change (max 4000).
section_id
body · string
The section it's about (GET /v1/proposals/{proposal_id} lists them).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/proposals/PROPOSAL_ID/edit" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"instruction": "Add a short FAQ about the 3-month minimum and make the pricing a table."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/proposals/PROPOSAL_ID/edit", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
instruction: "Add a short FAQ about the 3-month minimum and make the pricing a table.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/proposals/PROPOSAL_ID/edit",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"instruction": "Add a short FAQ about the 3-month minimum and make the pricing a table.",
},
)
print(res.json())
As Copy link: the link to share yourself, with nothing emailed or texted. A draft's page doesn't open, so a draft comes out of draft first (status sent). A template answers 409.
Parameter
Description
proposal_id
path · string · required
Proposal id.
allow_blanks
body · boolean
Let it go out with [blanks] the AI left for what it didn't know. Default false: 409 with the blanks.
Emails the client the link in your brand (a sub-account's: the business's), with your note. A sub-account's proposal to one of its leads goes through the lead's conversation as the key's person, by email and / or text (billed like any text or email; opted-out leads aren't sent to). A draft or declined proposal becomes sent; sending again re-sends the same link. sent_via lists what went, failures why a channel didn't. An accepted proposal or a template answers 409.
Parameter
Description
proposal_id
path · string · required
Proposal id.
channel
body · string
Default email. sms and both: a sub-account's proposal to a lead.
One of: email, sms, both
to_email
body · string
Default: the client's email (or the lead's).
note
body · string
Your words in the email instead of the standard ones (max 1500).
allow_blanks
body · boolean
Let it go out with [blanks] the AI left for what it didn't know. Default false: 409 with the blanks.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/proposals/PROPOSAL_ID/send" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"note": "Dana, here'\''s the plan we talked about. Happy to walk you through it on Thursday."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/proposals/PROPOSAL_ID/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
note: "Dana, here's the plan we talked about. Happy to walk you through it on Thursday.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/proposals/PROPOSAL_ID/send",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"note": "Dana, here's the plan we talked about. Happy to walk you through it on Thursday.",
},
)
print(res.json())
Duplicate, save as a template, or use for another client
POST/v1/proposals/{proposal_id}/duplicate
Read and writeUses creditsIdempotent
A copy with the same design and words and a new link, nothing sent or answered (an accepted proposal too: that's how a new version is made). as_template saves it as a template. Naming a client or a lead makes it theirs and the AI rewrites it for them, keeping the design and prices (Use for another client; rewrite: false keeps the words; the rewrite spends credits). It stays in its account.
Parameter
Description
proposal_id
path · string · required
Proposal id.
as_template
body · boolean
Save the copy as a template (no client).
title
body · string
The copy's name (max 200).
lead_id
body · string
A sub-account's lead it is for: fills in the client's name, email and phone, and its answer lands on the lead's timeline.
client_name
body · string
The client's name (max 200).
client_company
body · string
Their company (max 200).
client_email
body · string
Where it is emailed.
client_phone
body · string
Their phone.
client_website
body · string
Their website: a build reads it for context (it never quotes it word for word).
rewrite
body · boolean
For a client: the AI rewrites it for them. Default true.
Changes a sub-account's settings. Send only what changes.
Who can change what:
- Owners and admins of the sub-account: name, timezone, industry, logo_url, notify_on_appointments, enabled_features.
- Only the agency (the owner or an agency admin): archived, brand_id, hidden_features, monthly_credit_limit. Anyone else gets 403.
enabled_features is Settings > Features: tools only some businesses use, off until turned on. Send { key: true | false }; only the keys sent change.
- sales: the Sales page, and parts, tip and technician on won jobs.
- plans: Plans & memberships on won jobs.
- pipelines: More pipelines.
- quote_templates: Quote templates on estimates.
- new_numbers_in_messages: texts and calls from numbers the CRM doesn't know stay conversations in Messages (chat_only true on the lead) until they book or someone adds them to Leads.
hidden_features is what the agency hides from the sub-account's own people. Client admins, Staff and Technicians lose those pages, and their API keys get 403 feature_off on those routes. Send { key: true | false }; only the keys sent change.
- Pages: leads, messages, appointments, calendars, smart_forms, media, campaigns, calls, ai_voice, automations, landing_pages, invoices, sales, reports, refer, activity, team, ad_insights, support, agent, contracts, proposals.
- tools hides the whole Tools page. One key per tool: email_marketing, reward_games, loyalty_cards, short_links, website_analytics, click_guard, call_tracking, seo_tracker, offer_generator, website_widget, review_funnel, ai_visibility, listings.
- google hides every Google tool. One key each: google_reviews, google_posts, google_optimizer, google_rankings, google_desk, google_reports, google_embeds.
- A sub-account on an agency plan also follows what the plan leaves out (Agency > Plans & add-ons). A key sent here is this sub-account's own choice.
monthly_credit_limit is the most credits the sub-account may use in your billing period, every tool together. At the limit its texts, emails, AI and paid tools pause until the period renews; incoming texts and calls still come in. null means no limit.
Parameter
Description
name
body · string
The sub-account's name, up to 120 characters.
timezone
body · string
An IANA time zone, e.g. America/Chicago.
industry
body · string
Up to 80 characters.
notify_on_appointments
body · boolean
Alert the team when an appointment is booked.
archived
body · boolean
Agency only. Archives the sub-account, or brings it back.
brand_id
body · string
Agency only. One of your brands (GET /v1/brands), or null.
monthly_credit_limit
body · number
Agency only. A whole number of credits, 0 to 10,000,000, or null for no limit.
logo_url
body · string
Client logo URL, or null to remove it.
enabled_features
body · object
Settings > Features, e.g. { "sales": true }.
hidden_features
body · object
Hidden from the client's people, e.g. { "invoices": true, "team": false }. Owner or agency admin.
Configure outreach (auto-greet, AI replies, sending identity)
POST/v1/workspaces/{workspace_id}/outreach
Read and writeIdempotent
Sets a sub-account's outreach settings by their raw column names. PATCH on the same path does the same.
Prefer PATCH /v1/ai-texting and /v1/nurture-sequence: they take friendly names and check every value. Here, unknown fields are ignored and text is capped at 20,000 characters.
First text and email:
- auto_greet_new_leads, first_message_template, sms_template, sms_enabled.
- greet_delay_minutes_smart_form, greet_delay_minutes_default.
- email_enabled, email_from_address, email_from_name, email_subject, email_template.
AI replies:
- ai_enabled, ai_system_prompt, ai_business_context, ai_agent_name, ai_booking_link.
- ai_max_auto_replies, reply_delay_minutes, ai_auto_resume_minutes.
- handoff_on_unknown, handoff_pause_ai, handoff_resume_days.
- ai_can_cancel_appointments, ai_cancel_retention_enabled, ai_cancel_retention_note.
When things may send:
- greet_window_mode, greet_window_start, greet_window_end.
- followup_window_mode, followup_window_start, followup_window_end.
- respect_business_hours, quiet_hours_enabled, quiet_hours_start, quiet_hours_end.
Follow-ups, missed calls and reminders:
- nurture_enabled, nurture_steps.
- missed_call_text_enabled, missed_call_text_body.
- reminder_24h_enabled, reminder_24h_template, reminder_1h_enabled, reminder_1h_template.
- reminder_5m_enabled, reminder_5m_template (the 5-minute reminder, off by default).
- customer_confirmation_enabled, customer_confirmation_template.
- appointment_email_enabled, appointment_email_language (en | es).
Anyone who can manage the sub-account.
The sub-account's Refer & earn page: on (false when there is no referral program right now, and nothing else is sent), its link and code, the reward it earns (reward) out of reward_options, where it wants payouts sent, how long rewards are earned, the people it referred (paying or not) and its rewards with their status (pending, ready, paid). Owners and admins of the sub-account. A sub-account key gets 403 feature_off when Refer & earn is hidden from the account's people.
A whole Search campaign in one request, checked like the app's New campaign screen: its budget, bidding (Maximize conversions or Maximize conversion value only), locations, languages, up to 20 ad groups each with keywords and 1-3 responsive search ads, plus optional negatives, sitelinks, callouts, snippets and a phone number. It is always created PAUSED and spends nothing until POST /v1/google-ads/changes turns it on; a status other than PAUSED is refused. validate_only has Google check it without creating anything. Field names may be snake_case or camelCase. Written to the change history. Owners and admins; the sub-account must have Google Ads connected in the app (409 not_connected otherwise).
Makes up to 100 changes to a sub-account's Google Ads in one request: all of them or none. They are the same changes the app's Google Ads screens make.
! This can spend real ad money. Turning a campaign, ad group, keyword or ad on, or changing a budget, a bidding strategy or a bid, changes what the account spends. The answer's can_raise_spend says whether any change in the request could.
How to use it:
- Get the ids (campaign, ad group, keyword, budget, asset) from GET /v1/google-ads/report.
- Send changes: a list of { kind, ...fields }. Every kind and its fields are in the table below. Field names work in snake_case or camelCase.
- Send validate_only true first: Google checks the changes and nothing is made.
- Each applied request is one row of the change history, with a change_id. Most can be undone with POST /v1/google-ads/changes/{change_id}/undo.
- A change Google refuses answers 400, and nothing in the request is applied. details.errors names the change (change_index) and why.
Owners and admins.
Parameter
Description
changes
body · array · required
1-100 changes, each { kind, ... } (snake_case or camelCase fields). E.g. { kind: "campaign_status", campaign_id: "123", status: "PAUSED" } or { kind: "budget_amount", budget_id: "456", amount: 50, previous: 40 }.
customer_id
body · string
One of its Google Ads accounts. Default: the one picked in the app.
validate_only
body · boolean
Check with Google and change nothing. Default false.
review_id
body · string
With suggestion_id: marks that suggestion of an AI review as applied once the changes went through.
Every change made to the sub-account's Google Ads from the app, the API or Autopilot, newest first: what it was in words (summary), its kind and source, whether it can still be undone (can_undo) and when it was. Owners and admins.
Puts back one change from the history that has can_undo true, as the app's History > Undo does, and marks it undone. Undoing a pause turns the thing back on and undoing a budget cut raises it again, so this can spend real ad money (can_raise_spend). 409 when it was already undone or can't be undone from here. Owners and admins.
Parameter
Description
change_id
path · string · required
A change from GET /v1/google-ads/changes.
validate_only
body · boolean
Check with Google and change nothing. Default false.
Google's own recommendations for the account, each with its id, type, title, the campaign it is about, what it would change, and whether it can be applied from here (blocked / needs_input say why not). Owners and admins.
Parameter
Description
customer_id
query · string
One of its Google Ads accounts. Default: the one picked in the app.
Applies up to 100 of Google's recommendations, all or nothing. THIS CAN SPEND REAL AD MONEY: many recommendations raise budgets, add keywords or change bidding. Google has no dry run for recommendations, so validate_only checks the typed change each one makes instead (checked says which ones that covered). A recommendation Google no longer lists is a 409. Written to the change history. Owners and admins.
Parameter
Description
recommendation_ids
body · array · required
Ids from GET /v1/google-ads/recommendations (customers/{account}/recommendations/...).
customer_id
body · string
One of its Google Ads accounts. Default: the one picked in the app.
Rule-based suggestions from the account's own numbers: searches that spent and never converted, keywords and ads that lose money and more. Each comes with the ready-made changes to send to POST /v1/google-ads/changes. Free; nothing is changed. Owners and admins.
Parameter
Description
range
query · string
Default last_30d.
One of: today, last_7d, last_14d, last_30d, last_90d
customer_id
query · string
One of its Google Ads accounts. Default: the one picked in the app.
An AI review of the whole account (campaigns, keywords, searches, ads, targeting, Google's recommendations, keyword ideas): a summary and suggestions, each with checked changes ready to apply. It costs credits (the answer says how many; returned if the review fails), takes a few minutes and changes nothing by itself. Poll GET /v1/google-ads/review/{review_id}. 402 when the credits aren't there. Owners and admins.
Parameter
Description
range
body · string
Default last_30d.
One of: today, last_7d, last_14d, last_30d, last_90d
customer_id
body · string
One of its Google Ads accounts. Default: the one picked in the app.
A review you started (or an Autopilot run): status (processing, completed, failed), the summary, the suggestions with their changes, which were applied or dismissed, and for an Autopilot run what it applied and what Google refused. Reviews are their maker's own, as in the app.
Parameter
Description
review_id
path · string · required
From POST /v1/google-ads/review, or last_review_id of GET /v1/google-ads/autopilot.
Autopilot for one Google Ads account: on or off, daily or weekly, its rules, the next and last run with what the last one did, the Google recommendation types it may be allowed to apply, and the credits each run costs. Off until someone turns it on. Owners and admins.
Parameter
Description
customer_id
query · string
One of its Google Ads accounts. Default: the one picked in the app.
Turn Google Ads Autopilot on or off, set its rules
PUT/v1/google-ads/autopilot
Read and writeIdempotent
Autopilot is an AI review on a schedule that applies, without asking, the low-risk changes its rules allow and leaves the rest as suggestions. TURNING IT ON MEANS REAL CHANGES TO A LIVE AD ACCOUNT AND CREDITS FOR EVERY RUN, paid by the person who turned it on; with budget_change_pct above 0 or budget recommendation types it can raise budgets. The first run starts within about 10 minutes. Only what you send changes. Owners and admins.
Parameter
Description
enabled
body · boolean
On or off.
frequency
body · string
How often it runs.
One of: daily, weekly
rules
body · object
block_wasted_searches (boolean: exact negatives for searches that spent and never converted), pause_losing_keywords (boolean), pause_losing_ads (boolean), budget_change_pct (0-30: the most a budget moves per run, 0 = never), recommendation_types (list from GET /v1/google-ads/autopilot), max_changes_per_run (1-100).
customer_id
body · string
One of its Google Ads accounts. Default: the one picked in the app.
What an Autopilot run would change right now under the rules sent (or the saved ones), using the free rule-based suggestions: each change is checked with Google, nothing is changed, charged or saved. A real run also has the AI review, so it may find more. Owners and admins.
Parameter
Description
rules
body · object
Rules to try, as in PUT /v1/google-ads/autopilot. Default: the saved rules.
customer_id
body · string
One of its Google Ads accounts. Default: the one picked in the app.
Runs Autopilot right away with its saved settings: THIS COSTS CREDITS AND MAKES REAL CHANGES to the ad account within the saved rules. It answers at once; read the outcome from GET /v1/google-ads/autopilot (last_status, last_summary, last_review_id). 409 while a run is under way; 400 until settings were saved. Owners and admins.
Parameter
Description
customer_id
body · string
One of its Google Ads accounts. Default: the one picked in the app.
Places by name (cities, regions, ZIP codes, countries) with the ids a campaign's locations and add_locations changes take. Up to 15. Owners and admins.
The Google desk's Tasks for one sub-account: reply (a review reply written and waiting for an OK, or one Google refused), review (a review with no reply written yet), post (a draft waiting for an OK, one that failed, or one approved whose time passed without going out: status stuck with stuck_reason posts_off | not_connected | late), photo (a customer's or crew's photo waiting for an OK, or one Google refused) and fix (a Google connection to connect or reconnect). Each task carries its own fields (the review and draft, the post's words, the photo's link, the error). counts adds them up (older_reviews: unanswered reviews from before review_days, not listed); by_business splits them per sub-account. Act on them with the posts, reviews and photos routes. Owners and admins; needs the Google tools add-on (403 addon_locked).
Parameter
Description
kinds
query · string
Only these, comma separated: reply, review, post, photo, fix, google (a detail Google changed by itself: answer it with POST /v1/google-business/desk/google-changes/{change_id}).
review_days
query · number
Reviews from this many days back count, 1-3650 (default 90).
limit
query · number
1-1500 (default 200); total says how many there are.
The Google desk's Feed for one sub-account, newest first: post (published posts with their words, button and link on Google), reply (review replies that were sent, with the review), photo and video (uploaded to Google), report (weekly and monthly report emails: subject, how many recipients, opened_at), checkin (check-in emails to the owner) and faq (the website FAQ embed: its first questions). Keyset paging: send next.before and next.before_id back to read on (next is null at the end). Owners and admins; needs the Google tools add-on.
Parameter
Description
kinds
query · string
Only these, comma separated: post, reply, photo, video, report, checkin, faq.
The Google desk's Results for one sub-account: weeks (the last 12, oldest first: posts, replies, photos, videos and reports that went out, the reviews that came in and their average stars) and businesses (each Google business over the last days: posts, replies, photos, new reviews, their average stars, how many were answered, and when something last went out). Owners and admins; needs the Google tools add-on.
A desk task of kind google is a detail Google (or a customer's suggestion) changed on the profile by itself: its field, Google's version and the business's own. choice keep makes Google's version the business's, ours puts the business's version back on Google, dismiss leaves it and stops showing it. keep and ours change the live profile and are recorded as a change that can be undone (POST /v1/google-business/optimizer/changes/{id}/undo); the name, address and main category are never sent (they can send a profile back through verification). dry_run: true has Google check the change only. status answers kept, reverted, dismissed, gone (Google dropped it meanwhile) or validated. Owners and admins; needs the Google tools.
Parameter
Description
change_id
path · string · required
The task's id (GET /v1/google-business/desk/tasks, kind google).
Photos of Google Posts & Photos, in line order (up to 400): status pending (from a customer's review page or the crew's photo link, waiting for an OK), queued (in the line; scheduled_for is when it goes to Google), uploading, failed (Google refused it: error says why) or uploaded (on Google: uploaded_at, google_media_url). Also category, position, source (app, link, companycam, review), added_by, keeps_its_spot (it carries where it was taken, for geotags) and media_format. counts: pending, in_line, on_google. Owners and admins.
Parameter
Description
profile_id
query · string
Only this Google profile (default every profile of the sub-account).
A JPG or PNG from a public https link (up to 5 MB, at least 250 x 250 pixels; its type is read from the file itself): copied in and put last in the profile's line, then the line's upload times are worked out again (scheduled says whether that worked). It goes to Google on its time by itself only while the profile's automatic uploads are on and Google is connected; photos on Google are public. Needs a Google business on the sub-account (409 not_connected) and the Google tools add-on (403 addon_locked). Owners and admins.
A pending photo (from a customer or the crew) joins the end of the line, as Add to line in the app; nothing goes to Google before that. 409 when it isn't pending any more. Needs the Google tools add-on. Owners and admins.
Parameter
Description
photo_id
path · string · required
A pending photo (GET /v1/google-business/photos?status=pending).
A pending, queued or failed photo leaves the line (the rest move up). One already on Google is taken off Google too: google says deleted, gone (Google no longer had it), by_hand (it was added on Google by hand, so it stays there) or none. When Google refuses (409, details.code google_refused), here_only=true removes it here and leaves the one on Google. A photo going up right now answers 409: try again in a minute. Works without the Google tools add-on. Owners and admins.
The switches of Google Review Replies and Posts & Photos on one Google profile. Only what's sent changes. Turning these on makes things go to the business's public Google profile later, by themselves, with nobody approving each one: replies_enabled answers new reviews (a review with at least replies_auto_min_stars stars, 1-5, is answered on Google without asking; 6 makes every reply wait for approval); posts_enabled writes posts ahead (posts_per_week 1-7 at posts_hour 0-23 on the business's clock) and, with posts_auto_publish true, publishes them on Google by themselves (otherwise each waits for approval); photos_enabled adds photos_per_week (1-14) photos from the photo line at photos_hour. Also replies_tone (warm, professional, casual, upbeat) and posts_use_photos. The answer's goes_out_by_itself lists, in plain words, what now reaches Google without an approval. Turning a switch off is always safe. Owners and admins of the sub-account, with the Google tools add-on (403 addon_locked without it).
Parameter
Description
profile_id
path · string · required
Google profile id (GET /v1/google-business/profiles).
replies_enabled
body · boolean
Answer new reviews automatically.
replies_auto_min_stars
body · number
1-5: reviews with at least this many stars are answered without asking; 6: always ask first.
The comments people left on the sub-account's Facebook and Instagram ads (Ad Insights > Comments), newest first. Each has its status (open = waiting on the business, replied, hidden, removed, done = set aside), what the AI made of it (category, reason, suggested_reply, wants_hidden), the reply that went out, anything waiting to go out, and the ad it is on. Read on with before = next_before. Anyone who works in the sub-account; the client's people get 403 while the agency manages the ads for them.
Parameter
Description
status
query · string
Only these, comma separated: open, replied, hidden, removed, done.
Ad comments: what is connected and what the AI does
GET/v1/ad-insights/comments/status
Read only
Which Facebook Pages and Instagram accounts the comments are read from (and whether each is connected), the AI settings, how many replies or hides are waiting to go out, when comments were last read, and paused when Meta asked to slow down (nothing automatic runs until then).
Changes only the settings you send: reply_mode (off, suggest = the AI drafts and a person sends, auto = the AI replies), reply_categories (question, interest, praise, complaint, other), hide_mode (off, review = marked for a person, auto), hide_categories (spam, abuse, complaint), hide_action (hide or delete), blocked_words, tone (friendly, professional, playful, short), instructions and cta. Owners and admins. Turning a mode off drops what it had waiting. Answers the same view as the status route.
Parameter
Description
settings
body · object · required
The fields to change (they can also be sent at the top level).
Reads the newest comments from Meta now instead of waiting for the next automatic read (there is a short cooldown and a daily cap, to stay inside Meta's limits). The AI then reads what is new in the background; list them a little later.
For up to 50 open comments: approve (send each one's AI draft as the Page's reply), hide, delete (confirm: true; cannot be undone), done (set aside) or keep (the AI wanted them hidden; keep them). Replies, hides and deletes go out spaced apart, never together, to keep the Page safe: the answer says how many are waiting and about how long it takes. Refused with 409 while Meta has asked to slow down.
Posts a reply under the comment as the Page, right away. It is public: confirm the words with the person first. 409 for a hidden or removed comment (show it again first); 429 when Meta says slow down.
Parameter
Description
comment_id
path · string · required
The comment's id, from GET /v1/ad-insights/comments.
message
body · string · required
The reply, up to 2,000 characters.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/ad-insights/comments/COMMENT_ID/reply" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"message": "We do! Send us a message and we'\''ll get you on the schedule."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/ad-insights/comments/COMMENT_ID/reply", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
message: "We do! Send us a message and we'll get you on the schedule.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/ad-insights/comments/COMMENT_ID/reply",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"message": "We do! Send us a message and we'll get you on the schedule.",
},
)
print(res.json())
The AI writes (or rewrites) a reply from what it knows about the business; nothing is posted. The draft is kept on the comment as its suggested_reply. Uses the sub-account's daily AI allowance for comments (429 when it is used up).
Parameter
Description
comment_id
path · string · required
The comment's id, from GET /v1/ad-insights/comments.
Pauses one ad in the sub-account's Meta ad accounts (the ads GET /v1/ad-insights shows; ad_id is Meta's id). Only an ad in an ad account attached to this sub-account, and shown on its dashboard, can be changed. The agency's own people always can; the client's people only when the agency lets them pause ads (403 otherwise). Kept in the sub-account's ad action log.
Parameter
Description
ad_id
path · string · required
Meta's ad id.
ad_account_id
body · string
Meta ad account id. Needed only when the sub-account has more than one.
Pauses a campaign in the sub-account's Meta ad accounts (campaign_id is Meta's id, from GET /v1/ad-insights). Only a campaign in an attached ad account and shown on the sub-account's dashboard. The client's people need the agency's switch for pausing campaigns (403 otherwise). Kept in the ad action log.
Parameter
Description
campaign_id
path · string · required
Meta's campaign id.
ad_account_id
body · string
Meta ad account id. Needed only when the sub-account has more than one.
Sets the daily (default) or lifetime budget of a campaign, or of the ad set that holds the budget (send its id as campaign_id). amount is in the ad account's currency: 25 means $25.00. The client's people need the agency's switch for adjusting budgets, and stay inside the daily range the agency set (400 with the range otherwise). Raising a budget spends more ad money: confirm with the person first. Kept in the ad action log.
Parameter
Description
campaign_id
path · string · required
Meta's id of the campaign or ad set.
amount
body · number · required
The new budget in the ad account's currency (up to 100,000).
type
body · string
daily (default) or lifetime.
One of: daily, lifetime
ad_account_id
body · string
Meta ad account id. Needed only when the sub-account has more than one.
Exactly what its Ad Insights page shows: spend, leads, cost per lead, impressions and clicks for the Meta ad accounts attached to it (one, or all of them added up with each account's share in accounts, and an error for one that couldn't be read), each read with whichever connected Facebook profile can; per campaign and per ad, only the campaigns and ads the agency picked for this sub-account; ads left out (ads_hidden) when the agency hides them from the client. Amounts are added up in each account's own currency (accounts_meta). 403 ad_insights_off when Ad Insights is off for it.
Parameter
Description
ad_account_id
query · string
"all" (default) or one attached account, act_123.
date_preset
query · string
Default last_30d.
One of: today, yesterday, last_7d, last_14d, last_30d, last_90d, this_month, last_month, maximum
The sub-account's own Google Ads connection (Ad Insights > Google Ads): its ad accounts (customers), the one in use, whether booked / won leads are sent back as conversions and to which conversion actions, and the newest conversions with their status (pending, sent, failed, skipped) and how each lead was matched (gclid, gbraid, wbraid or email / phone). Owners and admins.
One of the Google Ads screens, read live from Google for one of the sub-account's ad accounts: overview (campaigns with spend, clicks, conversions, totals and by day), ad_groups, keywords, ads, search_terms, negatives, campaign_settings (campaign_id), conversion_actions, bidding, recommendations. Nothing is changed. Owners and admins.
Every Business Profile connected to the sub-account (it can have several): the location, rating, review count, whether Google's API answers for it, and its auto-reply, auto-post and photo settings, local knowledge, words for replies and photo geotag spot; plus the Google logins connected (email only). Owners and admins.
Each Profile Optimizer check, newest first: the score, what it found, the keywords, its suggestions and the changes made from it (and undone). Owners and admins.
Where the business ranks on Google Maps across a grid around it: the keywords tracked (grid, schedule, next and last scan) and the scans, newest first, each with its summary (points, found, top 3, average rank). Owners and admins.
Every grid point with its rank (null: not in the top 20), the competitors found, and the next steps to rank #1 once they've been written (they are written when the scan is first opened in the app). Owners and admins.
The directories the business is being listed on: each one's status (queued, scanning, listed, mismatch, not_listed, working, needs_you, submitted, live, owner, skipped, failed) with counts, what differs or what's needed from the owner, the listing link, and the latest activity. Passwords and verification codes are never returned. Owners and admins.
A post in your own words, Google's rules checked first. Saved as a draft waiting for an OK, or approved at once with approve: true (it then goes up publicly on the business's Google profile on scheduled_for, on its own when the profile is connected to Google; otherwise the app shows it to copy). Owners and admins.
Parameter
Description
profile_id
body · string
One of its profiles (default its first).
kind
body · string
STANDARD (an update, default), OFFER or EVENT.
One of: STANDARD, OFFER, EVENT
title
body · string
OFFER and EVENT posts: up to 58 characters.
body
body · string · required
The post, up to 1,500 characters. Google refuses a phone number in the text: use the CALL button.
cta_type
body · string
The button (not on OFFER posts). Left out: the profile's own button and link.
One of: NONE, LEARN_MORE, BOOK, CALL, ORDER, SHOP, SIGN_UP
cta_url
body · string
Full https:// link for the button (or an offer's link).
coupon_code
body · string
OFFER: the code, up to 58 characters.
offer_terms
body · string
OFFER: terms and conditions.
starts_at
body · string
EVENT: when it starts, ISO date-time.
ends_at
body · string
EVENT: when it ends; OFFER: when it ends (default 30 days). ISO.
image_url
body · string
A public link to a JPG or PNG (5 MB, 250 x 250 at least), copied in like an upload.
scheduled_for
body · string
When it goes up on Google, ISO date-time (default: the next posting day on the profile's schedule).
approve
body · boolean
true: approved now (scheduled), as the app's Schedule it. Default false (a draft).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/google-business/posts" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"body": "Spring tune-ups are open: book a visit and we'\''ll check your whole system in under an hour.",
"cta_type": "BOOK",
"cta_url": "https://acmehvac.com/book"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/google-business/posts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
body: "Spring tune-ups are open: book a visit and we'll check your whole system in under an hour.",
cta_type: "BOOK",
cta_url: "https://acmehvac.com/book",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/google-business/posts",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"body": "Spring tune-ups are open: book a visit and we'll check your whole system in under an hour.",
"cta_type": "BOOK",
"cta_url": "https://acmehvac.com/book",
},
)
print(res.json())
Response 201
JSON
{
"success": true,
"data": {
"post": {
"id": "uuid",
"workspace_id": "uuid",
"profile_id": "uuid",
"status": "draft",
"kind": "STANDARD",
"title": null,
"body": "Spring tune-ups are open: book a visit and we'll check your whole system in under an hour.",
"cta_type": "BOOK",
"cta_url": "https://acmehvac.com/book",
"coupon_code": null,
"offer_terms": null,
"starts_at": null,
"ends_at": null,
"image_url": null,
"scheduled_for": "2026-11-03T17:00:00Z",
"published_at": null,
"google_post_url": null,
"source": "user",
"error": null,
"created_at": "2026-10-29T15:00:00Z",
"updated_at": "2026-10-29T15:00:00Z"
}
},
"error": null
}
The AI writes 1-8 posts in the business's voice from an idea, or one post about each photo of the work in photo_urls (the post carries that photo), dated on the profile's posting days. They are saved as drafts: nothing goes to Google until one is approved or published. Owners and admins.
Parameter
Description
profile_id
body · string
One of its profiles (default its first).
idea
body · string
What to write about, up to 600 characters (needed for OFFER and EVENT).
kind
body · string
STANDARD (an update, default), OFFER or EVENT.
One of: STANDARD, OFFER, EVENT
count
body · number
1-8, default 4 (with photo_urls: one per photo).
photo_urls
body · array
Up to 8 public JPG or PNG links of the business's work.
cta_type
body · string
The button (not on OFFER posts). Left out: the profile's own button and link.
One of: NONE, LEARN_MORE, BOOK, CALL, ORDER, SHOP, SIGN_UP
cta_url
body · string
Full https:// link for the button (or an offer's link).
starts_at
body · string
EVENT: when it starts, ISO date-time.
ends_at
body · string
EVENT: when it ends; OFFER: when it ends (default 30 days). ISO.
scheduled_for
body · string
The date of a single post, ISO.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/google-business/posts/write" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"idea": "Free furnace check with any tune-up this month",
"count": 2
}'
Change a post that isn't on Google yet (draft, scheduled or failed): send only what changes; image_url null removes the photo. Google's rules are checked on the result. A scheduled post stays approved for its new date. Owners and admins.
Parameter
Description
post_id
path · string · required
Post id (GET /v1/google-business/posts).
title
body · string
OFFER and EVENT posts: up to 58 characters.
body
body · string
The post, up to 1,500 characters. Google refuses a phone number in the text: use the CALL button.
cta_type
body · string
The button (not on OFFER posts). Left out: the profile's own button and link.
One of: NONE, LEARN_MORE, BOOK, CALL, ORDER, SHOP, SIGN_UP
cta_url
body · string
Full https:// link for the button (or an offer's link).
coupon_code
body · string
OFFER: the code, up to 58 characters.
offer_terms
body · string
OFFER: terms and conditions.
starts_at
body · string
EVENT: when it starts, ISO date-time.
ends_at
body · string
EVENT: when it ends; OFFER: when it ends (default 30 days). ISO.
scheduled_for
body · string
When it goes up on Google, ISO date-time (default: the next posting day on the profile's schedule).
image_url
body · string
A public JPG or PNG link, or null to remove the photo.
A draft becomes scheduled: it goes up publicly on the business's Google profile on its date (on its own when the profile is connected to Google). Google's rules are checked first and the date must not have passed (send scheduled_for to move it). Owners and admins.
Publishes the post publicly on the business's Google profile right away, as the app's Post now (a draft, scheduled or failed post). It needs the profile connected to Google; Google's rules are checked first. When Google doesn't take it the answer is 409 with details.code: awaiting_google (Google hasn't opened its API to the account yet) or not_posted (the reason is in error and on the post). Owners and admins.
Removes the post from the app. A post already published stays on Google (still_on_google: true); remove it there. Not while it is going up. Owners and admins.
The AI writes the reply in the business's voice and tone (the tool's reply settings), or rewrites it following instruction, and saves it as the review's draft. Nothing is posted. Owners and admins.
Parameter
Description
review_id
path · string · required
Review id (GET /v1/google-business/reviews).
instruction
body · string
How to write or change it, up to 600 characters (e.g. mention the warranty).
Posts text (or the saved draft) as the business's public reply under the review on Google, as the app's Post reply; on a review already answered it replaces the reply. Only reviews that came from Google with the profile connected: one read from Google Maps or pasted in answers 409 copy_by_hand (paste the reply on Google yourself); awaiting_google and not_posted as for posts. Owners and admins.
Parameter
Description
review_id
path · string · required
Review id.
text
body · string
The reply, up to 4,000 characters (default: the saved draft).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/google-business/reviews/REVIEW_ID/reply" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"text": "Thank you, Dana! We'\''re glad the new furnace is keeping you warm."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/google-business/reviews/REVIEW_ID/reply", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
text: "Thank you, Dana! We're glad the new furnace is keeping you warm.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/google-business/reviews/REVIEW_ID/reply",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"text": "Thank you, Dana! We're glad the new furnace is keeping you warm.",
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"review": {
"id": "uuid",
"workspace_id": "uuid",
"profile_id": "uuid",
"source": "api",
"reviewer_name": "Dana R.",
"star_rating": 5,
"comment": "Fast and friendly.",
"reply_text": "Thank you, Dana! We're glad the new furnace is keeping you warm.",
"draft_reply": "Thank you, Dana! It was a pleasure.",
"status": "sent",
"sent_by": "user",
"error": null
}
},
"error": null
}
Makes the picked suggestions of a Profile Optimizer check (the newest, or run_id) on the business's live Google profile, which everyone sees: categories added, a new description, services, attributes turned on, the Book button linked to one of its calendars, holiday hours, the website link (website_link) and the opening date. Ids come from the run's suggestions (GET /v1/google-business/optimizer). Each change is recorded and can be undone; dry_run: true asks Google to check them without changing anything. results says what worked. Owners and admins.
Parameter
Description
profile_id
body · string
One of its profiles (default its first).
run_id
body · string
The check (default the newest).
categories
body · array
Category ids to add (suggestions.categories[].id).
description
body · string
The description to use, 50-750 characters (the suggested one, edited or not).
services
body · array
Service ids (suggestions.services[].id).
service_updates
body · array
Better descriptions for services already on the profile (suggestions.serviceUpdates[].id). Only those change; every other service goes back as Google has it, and a service edited on Google since the check is left out.
attributes
body · array
Attribute ids to turn on (suggestions.attributes[].id).
booking_calendar_id
body · string
The calendar the Book button opens (suggestions.booking.calendars[].id).
holidays
body · array
[{ key, closed }] from suggestions.holidays (closed defaults to true).
website_link
body · boolean
true: put suggestions.websiteLink.url on the profile (tracking tags on the website link, or the business's site when the profile has none).
opening_date
body · object
{ year, month }: when the business opened, when suggestions.openingDate asks for it.
Puts what was on the Google profile before that change back (the change ids are in GET /v1/google-business/optimizer, runs[].changes). Owners and admins.
Tracks where the business ranks on Google Maps for a search, across a grid of points centred on the business (or center_lat / center_lng). On a schedule (weekly by default) its first scan runs within minutes and then on the schedule; each scan costs 0.25 (5x5), 0.5 (7x7), 1 (9x9) or 2 (13x13) credits from the account, the first 3 scans of a business are free. Up to 10 keywords per business. Owners and admins.
Parameter
Description
profile_id
body · string
One of its profiles (default its first).
keyword
body · string · required
What people search, e.g. "furnace repair" (up to 80 characters).
grid_size
body · number
Points per side: 5, 7 (default), 9 or 13.
spacing_m
body · number
Meters between points: 402, 805, 1609 (default), 2414, 3219, 4828 or 8047.
center_lat
body · number
With center_lng: the grid's centre (default the business).
Changes a tracked search: how often it's scanned (schedule weekly, monthly or off), the search itself or its grid. Send only what changes; the rest stays as saved. A search never scanned that goes onto a schedule is scanned within minutes (credits, as a scan). Its past scans stay, and GET /v1/map-rankings?keyword_id= reads its ranking over time. Owners and admins.
Parameter
Description
keyword_id
path · string · required
Keyword id (GET /v1/map-rankings).
schedule
body · string
weekly, monthly or off.
One of: off, weekly, monthly
keyword
body · string
What people search (up to 80 characters).
grid_size
body · number
Points per side: 5, 7, 9 or 13.
spacing_m
body · number
Meters between points: 402, 805, 1609, 2414, 3219, 4828 or 8047.
Starts a scan of the keyword's grid (202): 0.25 to 2 credits by grid size, from the account (free for the first 3 scans of a business); points Google never answers are refunded. One scan of a keyword at a time: while one runs, that one is returned. It takes a few minutes; read it with GET /v1/map-rankings/scans/{scan_id}. 402 when there aren't enough credits. Owners and admins.
The free check of every directory (202): starts Business Listings for the business, or looks again for the current run (at most every 6 hours). business sets the details every directory gets (default: from its Google profile); they can change until something has been sent. Read the results with GET /v1/listings. Owners and admins.
Signs the business up, with its details, on every directory the check didn't find it on or found with wrong details, as the app's Start: those listings are public. 8 credits a directory from the account, refunded for each that ends without a listing; credits_charged says how many. Some directories then need the owner (a code, a robot check): GET /v1/listings shows them. Owners and admins.
AI Visibility: how often AI assistants name the business
GET/v1/ai-visibility
Read only
Does ChatGPT, Gemini, Google AI Mode / AI Overviews, Perplexity or Claude name this business when asked what its customers ask? A check asks every question on every engine, several times where answers change. The number is how often the business is named, always with the count (named of answers; rate is 0-1): answers don't repeat, so it is never a rank. available is false until the feature is switched on, set_up false until POST /v1/ai-visibility/setup. latest_check is the newest finished one: per engine (real_app false = measured through its API, not its app), per question (questions about the business by name don't count towards the rate), named_instead (who else is named, by how many answers), sources (the sites the answers read) and facts (is the phone, address and hours it gives right). wrong_details lists what it gets wrong. last_four_weeks and months add checks up, with rate_low and rate_high (a 90% range); trend says up or down only when the ranges don't overlap. running is a check still going (about five minutes). checks lists the newest 20 (GET /v1/ai-visibility/checks/{check_id} opens any one whole, to compare two dates); steps_done are plan steps someone ticked off. pricing.next_check_credits is what the next check costs. A sub-account can track several locations, one per Google profile: locations lists them with their latest count (location_id null = a Google profile not tracked yet), and everything else here is about one of them, its first unless location_id or profile_id says otherwise. Owners and admins. An add-on: 403 addon_locked without it. 403 feature_off for a client when the agency hides Tools.
Parameter
Description
location_id
query · string
Which tracked location (locations in GET /v1/ai-visibility). Leave out for the sub-account's first.
What the account already knows, for setting up AI Visibility
GET/v1/ai-visibility/prefill
Read only
The business's name, website, phone, address, what it does, town and state, from its Google profile and sub-account, as the set-up screen fills them in; competitor is the one Map Rankings sees most. POST /v1/ai-visibility/setup uses these for anything you leave out. towns is the area around it, from its Google service area and neighborhoods. Owners and admins.
Parameter
Description
location_id
query · string
Which tracked location (locations in GET /v1/ai-visibility). Leave out for the sub-account's first.
The AI writes the questions to check, for this business, or plain templates when it can't. Free, and nothing is saved: pass them on to POST /v1/ai-visibility/setup or PUT /v1/ai-visibility/questions. Anything left out comes from what the account knows. Owners and admins.
Parameter
Description
business_name
body · string
Default: the account's.
service
body · string
What it does, in a customer's words.
services
body · array
Other services (up to 8).
town
body · string
Default: the account's.
state
body · string
Default: the account's.
towns
body · array
Up to 5 towns around the location the questions also name.
competitor
body · string
A competitor, for the comparison question.
location_id
body · string
Which tracked location (locations in GET /v1/ai-visibility). Leave out for the sub-account's first.
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/ai-visibility/ideas",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"service": "garage door repair",
"town": "Encino",
"state": "CA",
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"questions": [
{
"text": "Who is the best garage door repair in Encino?",
"kind": "discovery"
},
{
"text": "How much does a garage door spring cost in Encino?",
"kind": "cost"
}
]
},
"error": null
}
Saves the business's details and questions and starts the first check straight away. Spends credits: 0.75 a question (1.50 with Claude, which is on by default), the first check's first 10 questions free; answers that never come back are refunded. Anything left out comes from what the account knows (GET /v1/ai-visibility/prefill); 400 when it doesn't know business_name, service or town. A question naming the business is added when none is sent. Checks then run on schedule (weekly by default). 409 already_set_up when that location already is: use PUT /v1/ai-visibility/settings, PUT /v1/ai-visibility/questions and POST /v1/ai-visibility/check. To track another location send its profile_id, or add_location true with its details; only a sub-account's very first check has free questions. 402 when there aren't enough credits. Owners and admins.
Parameter
Description
questions
body · array · required
[{ text, kind }] up to 20, at least one a customer would ask. kind: discovery, cost, branded (names the business) or comparison; left out, it's guessed from the words.
business_name
body · string
Default: the account's.
aliases
body · array
Other names it goes by (up to 6).
website
body · string
Default: the account's.
phone
body · string
Default: the account's. The fact check compares with it.
address
body · string
Default: the account's.
service
body · string
What it does, in a customer's words.
town
body · string
Default: the account's.
state
body · string
Default: the account's.
towns
body · array
Up to 5 towns around the location the questions also name.
location_id
body · string
Which tracked location (locations in GET /v1/ai-visibility). Leave out for the sub-account's first.
profile_id
body · string
Start tracking this Google profile.
add_location
body · boolean
A new location that isn't one of its Google profiles.
claude
body · boolean
Also ask Claude. Default true.
schedule
body · string
How often to check. Default weekly.
One of: off, weekly, monthly
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/ai-visibility/setup" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"questions": [
{
"text": "Who is the best garage door repair in Encino?",
"kind": "discovery"
},
{
"text": "How much does a garage door spring cost in Encino?",
"kind": "cost"
}
]
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/ai-visibility/setup", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
questions: [
{
text: "Who is the best garage door repair in Encino?",
kind: "discovery",
},
{
text: "How much does a garage door spring cost in Encino?",
kind: "cost",
},
],
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/ai-visibility/setup",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"questions": [
{
"text": "Who is the best garage door repair in Encino?",
"kind": "discovery",
},
{
"text": "How much does a garage door spring cost in Encino?",
"kind": "cost",
},
],
},
)
print(res.json())
Replaces the whole list: send every question to keep. A question that stays (same words) keeps its id and history. At least one a customer would ask, at most 20; a question naming the business is added when none is sent. 404 until it's set up. Owners and admins.
Parameter
Description
questions
body · array · required
[{ text, kind }]. kind: discovery, cost, branded (names the business) or comparison; left out, it's guessed from the words.
location_id
body · string
Which tracked location (locations in GET /v1/ai-visibility). Leave out for the sub-account's first.
profile_id
body · string
Or which of the sub-account's Google profiles.
Request
cURL
curl -X PUT "https://api.localflywheel.com/v1/ai-visibility/questions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"questions": [
{
"text": "Who is the best garage door repair in Encino?",
"kind": "discovery"
},
{
"text": "Is Acme Garage Doors any good?",
"kind": "branded"
}
]
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/ai-visibility/questions", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
questions: [
{
text: "Who is the best garage door repair in Encino?",
kind: "discovery",
},
{
text: "Is Acme Garage Doors any good?",
kind: "branded",
},
],
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.put(
"https://api.localflywheel.com/v1/ai-visibility/questions",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"questions": [
{
"text": "Who is the best garage door repair in Encino?",
"kind": "discovery",
},
{
"text": "Is Acme Garage Doors any good?",
"kind": "branded",
},
],
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"questions": [
{
"id": "uuid",
"text": "Who is the best garage door repair in Encino?",
"kind": "discovery"
},
{
"id": "uuid",
"text": "Is Acme Garage Doors any good?",
"kind": "branded"
}
]
},
"error": null
}
Asks every question again, and takes about five minutes; read it with GET /v1/ai-visibility. Spends credits: 0.75 a question, 1.50 with Claude (pricing.next_check_credits in GET /v1/ai-visibility); answers that never come back are refunded. While one is running that one is returned and nothing is charged. 402 when there aren't enough credits, 404 until it's set up. Owners and admins.
Every answer to one question in one check, for reading: the words, who it named in the order it named them (you is this business) and the sites it read. repeat is which time it was asked; asked_from says how (Google AI Mode: computer_nearby, phone_nearby, computer_elsewhere or phone_elsewhere). about_the_business is what it said on a question naming the business. The words of checks older than 180 days are gone; their numbers stay. Owners and admins.
Parameter
Description
check_id
query · string · required
latest_check.id from GET /v1/ai-visibility.
question
query · string · required
The question exactly as by_question has it.
engine
query · string
Only this engine.
One of: chatgpt, gemini, ai_mode, aio, perplexity, claude
A plan written from what the check measured, once per check, free, the first time it's asked for. state: writing (ask again in a few seconds), ready, or none (the check isn't finished). tool names the sub-account tool for a step: listings, reviews, google-optimizer, google-posts, google-embeds, smart-pages or null; copy is exact text to paste (robots.txt lines); done_at when someone ticked it off. website_prompts are prompts to paste into the AI that edits the website (its builder's AI, ChatGPT or Claude), built from this check and the Google profile, never by a model: key crawlers, readable, details (with the business details markup), questions, services, or review (the last: for ChatGPT or Claude to read the site and suggest more); website_prompts_all is every website fix as one prompt, or null with fewer than two. website is the plan's look at the business's site, what an AI crawler that runs no scripts reads there: reachable (status 403 = its firewall turned the check away, so what is on it is unknown and the rest is null, never false), ai_crawlers_blocked (by robots.txt), words_without_scripts, business_markup (schema.org with an address or phone), faq_markup, phone_on_page. Owners and admins.
import os
import requests
res = requests.get(
"https://api.localflywheel.com/v1/ai-visibility/checks/CHECK_ID/advice",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"state": "ready",
"headline": "AI names you in a quarter of its answers; fix your phone number first",
"steps": [
{
"title": "Correct your phone number on the directories",
"why": "ChatGPT gives out an old number.",
"how": "Update Yelp and Angi, the two sites it reads most.",
"tool": "listings",
"copy": null,
"done_at": null
}
],
"website": {
"site": "acmegaragedoors.com",
"reachable": true,
"status": 200,
"ai_crawlers_blocked": [
"GPTBot"
],
"words_without_scripts": 640,
"business_markup": false,
"faq_markup": false,
"phone_on_page": true,
"checked_at": "2026-11-08T12:09:00Z"
},
"website_prompts": [
{
"key": "questions",
"title": "Add answers to the questions customers ask AI",
"why": "Asked \"who can fix a garage door spring today in Encino?\", AI named you in 0 of 15 answers.",
"text": "I'm improving my business's website so AI assistants ... read it correctly ..."
}
],
"website_prompts_all": null,
"written_at": "2026-11-08T12:10:00Z"
},
"error": null
}
Marks a step of a check's plan done (or not done again with done false). The app's chart marks the day, GET /v1/ai-visibility lists it under steps_done, and the next check's plan knows it was done. Answers the plan. Owners and admins.
{
"success": true,
"data": {
"state": "ready",
"headline": "AI names you in a quarter of its answers; fix your phone number first",
"steps": [
{
"title": "Correct your phone number on the directories",
"why": "ChatGPT gives out an old number.",
"how": "Update Yelp and Angi, the two sites it reads most.",
"tool": "listings",
"copy": null,
"done_at": "2026-11-10T16:00:00Z"
}
],
"website": null,
"website_prompts": [],
"website_prompts_all": null,
"written_at": "2026-11-08T12:10:00Z"
},
"error": null
}
Any check kept (GET /v1/ai-visibility lists the newest 20 under checks), as latest_check shows the newest: per engine and question, who is named instead, the sources, the facts it got right or wrong. Two of them side by side compare two dates; a check that isn't finished comes back without the breakdown. Owners and admins.
The cards at the top of Ad Insights and the custom metrics
GET/v1/ad-insights/cards
Read only
What the key's person sees at the top of the sub-account's Ad Insights. cards are in showing order, then the ones hidden (kind: standard, ready_made, custom). source: personal (their own), team (saved for everyone) or default (the eight usual ones). metrics are the custom metrics: format is what was picked, shows_as what auto comes to, problem why one can't be worked out. numbers are what a formula can use; a percent is a fraction, as in a spreadsheet. Any member of the sub-account. 403 feature_off for a client when the agency hides Ad Insights.
Starts from what the key's person sees now and shows on the page as soon as it's saved. cards = the card ids to show, in order, and every other card hides. metrics = metrics to add or change (by id, else by name): name, formula over the numbers GET lists (AOV - CPA, Revenue * 40% - Spend; + - * / and brackets), format auto (default), money, number, percent or ratio, per_campaign to make it a column of Campaign Performance; a new one's card shows last, a rename carries into the formulas using it, and a formula that can't be read is a 400 that says why. delete_metrics = metric ids; refused when a metric you're keeping uses it. Saves the person's own cards unless for_everyone: true (owners and admins: their cards become everyone's, and personal cards made before give way). for_everyone alone saves what they see now. reset: true drops their own cards. Answers as GET does.
Parameter
Description
cards
body · array
Card ids to show, in order. Leave out to keep them.
metrics
body · array
[{ id, name, formula, format, per_campaign }] to add or change. The others stay.
delete_metrics
body · array
Metric ids to delete.
for_everyone
body · boolean
Make these everyone's cards in the sub-account.
reset
body · boolean
Drop this person's own cards (back to the team's, or the usual ones). Goes alone.
Tools > Google Reports: whether the weekly and monthly emails go, the day and hour (in the sub-account's time zone), who gets them, the check-ins, what the emails show and next_note, your note at the top of the next one. saved is false until someone saves them, and the settings are then the defaults. Owners and admins, with the Google tools add-on (403 addon_locked without it).
The app's Save. Send only what changes. Turning reports on needs someone to send them to (400 otherwise). enabled: true means real emails go to recipients, in the agency's brand, on their schedule. Owners and admins, with the Google tools add-on.
Parameter
Description
enabled
body · boolean
Reports on or off.
weekly
body · boolean
The weekly summary.
monthly
body · boolean
The monthly report (first weekday from the 4th).
send_day
body · number
The weekly's day: 0 = Sunday ... 6 = Saturday.
send_hour
body · number
The hour, 5 to 20, in the sub-account's time zone.
recipients
body · array
Up to 10 email addresses.
nudge_reviews_days
body · number
Check-in after this many days without a new Google review: 7, 10, 14, 21 or 30; null for off.
nudge_photos
body · boolean
Check-in when automatic photo uploads have under a week left.
nudge_wins
body · boolean
Check-in after a great week of reviews.
show_drops
body · boolean
Show numbers that went down too (off: only gains get a %).
compare
body · boolean
This period next to the one before.
rank_maps
body · boolean
The Map Rankings heat maps.
next_note
body · string
Your words at the top of the next weekly or monthly report, in your name, up to 1,200 characters; cleared once that one goes out. null clears it now.
Newest first: each email's kind, status (sent, failed, sending), who got it, the numbers it showed for each business (reviews, posts, photos, Google's own numbers, Map Rankings) and link, the public web version anyone with the link can open. Owners and admins, with the Google tools add-on.
Parameter
Description
kind
query · string
Only this kind.
One of: weekly, monthly, reviews_quiet, photos_low, wins
The app's Send me a test: the report as it would go now, marked [Test], to the email of the person this key belongs to and nobody else. It takes no address. 400 until the business is found on Google. Owners and admins, with the Google tools add-on.
Parameter
Description
kind
body · string
Default weekly.
One of: weekly, monthly, reviews_quiet, photos_low, wins
What a Google profile shows now on the coming US holidays (75 days) and on its other special days ahead: hours is closed, the hours that day ("09:00-14:00") or null with set false (nothing set: Google shows the usual hours). has_regular_hours false means Google needs regular hours before holiday hours. Read live from Google. Owners and admins, with the Google tools add-on.
Sets the days sent on the Google profile, live: closed, usual or its own hours. Every other special day stays as it is. Recorded like a Profile Optimizer change (undo it with POST /v1/google-business/optimizer/changes/{change_id}/undo) and listed in the client's next report. 400 with Google's reason when it refuses. Owners and admins, with the Google tools add-on.
Parameter
Description
profile_id
body · string
One of its Google profiles (default its first).
days
body · array · required
Up to 12 days: { date: "2026-11-26", hours: "closed" | "usual" | "09:00-14:00", name?: "Thanksgiving" }. usual is that weekday's regular hours. From today (the business's time zone) to a year out.
Everything that can be edited by hand on a Google Business Profile, read live from Google: the website link, phone, description, hours (each day's open stretches; an empty day is closed, 00:00 to 24:00 is open all day), opening date, main and extra categories, services (id, kind google or custom, name, description, the category it sits under), service_catalog (Google's own services for each of its categories, on_profile true for the ones already there), the Book button's link, its booking calendars, and the social links Google offers this business. pending_review true means Google is still reviewing an earlier edit. Owners and admins, with the Google tools add-on.
Changes the fields sent on the business's live Google profile, which everyone sees. Each field goes to Google on its own, against the profile as it is at that moment, and answers its own result (ok with what changed, or Google's reason), so one refused field doesn't stop the rest; a field already like that on Google answers ok with a message and changes nothing. Services and categories are steps (add, update, remove), never a whole list, so an edit made on Google meanwhile is kept. Every change is recorded like a Profile Optimizer change: undo it with POST /v1/google-business/optimizer/changes/{change_id}/undo, and the client's next report lists it. dry_run: true has Google validate without saving (the Book link and social links have no such check and are skipped). Never changed here: the business name, the address and the main category. A new phone number can make Google ask to verify the business again. Owners and admins, with the Google tools add-on.
Parameter
Description
profile_id
body · string
One of its Google profiles (default its first).
website
body · string
The website link; "" takes it off.
phone
body · string
The main phone number, 7 to 15 digits.
hours
body · object
The whole week: { MONDAY: [{ open: "08:00", close: "17:00" }], ... }. A day left out or with an empty list is closed, up to 3 stretches a day, 00:00 to 24:00 is open all day, a close before the open runs past midnight.
description
body · string
Up to 750 characters, no links; "" clears it.
services
body · object
{ add: [{ kind: "google", service_type_id, description? } | { kind: "custom", name, category, description? }], update: [{ id, description?, name? }], remove: [id] }. Ids and service_type_ids come from GET /v1/google-business/profile; a custom name can only be changed on a custom service; descriptions up to 300 characters.
categories
body · object
{ add: [category id], remove: [category id] } for the extra categories (up to 9). Ids like categories/gcid:gutter_service.
booking_link
body · string
The Book button's link, "" to take it off, or { calendar_id } for one of its booking calendars.
links
body · object
Social links by id from GET /v1/google-business/profile: { url_facebook: "https://facebook.com/acme", url_instagram: "" } ("" takes one off).
Tools > Website embeds: review widgets, photo galleries, Latest updates, FAQs and schema markup, each with snippet, the one line to paste on the business's website. Each is drawn from the live Google data. Owners and admins, with the Google tools add-on.
One widget for the business's website, on its Google business (profile_id, default its first). Nothing shows anywhere until its snippet is pasted on a site. Settings a kind doesn't have, or a value it wouldn't keep, are refused (400). At most 100 per sub-account. Owners and admins, with the Google tools add-on.
Parameter
Description
profile_id
body · string
One of its Google businesses (default its first).
kind
body · string · required
What it shows.
One of: reviews, photos, posts, faq, schema
name
body · string
For the team, up to 80 characters (default the kind's name).
settings
body · object
Every kind but schema: theme (light, dark, auto), accent (#rrggbb), radius (0-28), font (site, system), heading. reviews: layout (carousel, grid, list, badge), minStars (4, 5), max (1-30), showReply, reviewButton, buttonText, summary, hidden (review ids not to show). photos: layout (grid, masonry, mosaic, carousel, slideshow), max (1-96), columns (2-6), phoneColumns (1-3), ratio (square, landscape, wide, portrait), fit (cover, contain), gap (none, s, m, l), paging (all, more, pages; grid, masonry and mosaic) with rows (1-8) and buttonText / buttonStyle for the Show more button, arrows (top, sides, none), dots, autoplay (0, 4, 6, 8) and thumbs for the carousel and slideshow, captions (none, hover, always), hover (zoom, dim, none), lightbox, order (newest, oldest, shuffle), hidden (photo ids not to show, as in the embed JSON; the gallery shows the photos already on the Google profile and the ones sent through the tools). posts: layout (cards, list), max (1-12), open (modal, google). faq: openFirst, schema. schema: type (a schema.org type or auto), url.
faq
body · array
FAQ only: up to 20 { q, a } (a question up to 200 characters, an answer up to 1,200).
Changes what visitors see on any site it's pasted on, at once. Send only what changes: settings merge onto the saved ones (hide a review by putting its id in settings.hidden), faq replaces the whole list. Its kind and the line to paste never change. Owners and admins, with the Google tools add-on.
Free. Writes new questions from the business's own facts (its Google profile, the AI Brain, its hours) and what its reviews keep mentioning, and drops any answer claiming what those facts don't say (dropped counts them). Nothing is saved: written is what's new, faq the list with them added; check it and send it with PATCH /v1/google-business/embeds/{embed_id}. FAQ embeds only. 409 not_enough_facts until the Optimizer has run or the AI Brain has facts; 409 faq_full at 20 questions. Owners and admins, with the Google tools add-on.
Reads the pin, opening hours, type, phone, website and address from Google Maps onto every embed of that business, for its schema markup and FAQ. Owners and admins, with the Google tools add-on.
For a business whose owner should connect Google without the CRM: a page on the CRM's own domain, in the agency's brand, with no sign-in. It answers with the working link, or makes one when there's none, it expired (14 days) or it was used; reset: true replaces it. Only a Google account that manages this business can save a connection through it. state is ready, expired, connected or off. Owners and admins, with the Google tools add-on. Anyone holding the link can open the page, so send it only to the owner.
Parameter
Description
profile_id
body · string
One of its Google businesses (default its first).
reset
body · boolean
true: the old link stops working and a new one is made.
The link and 4-digit PIN crews use to add job photos to the Google profile with no sign-in (made the first time, as in the app). Give them only to the crew: both together can add photos to the line. Owners and admins, with the Google tools add-on.
Local knowledge (the Optimizer may name places from it), the words review replies work in now and then, and whether photos going to Google carry a location (a job's own GPS first, then this spot, then the business's pin). Send only what changes; geotag_lat and geotag_lng go together and null clears the spot. Auto-replies and auto-posting stay in the app. Owners and admins, with the Google tools add-on.
Parameter
Description
profile_id
path · string · required
Profile id.
local_notes
body · string
Streets, neighborhoods, landmarks and weather its customers know, up to 1,500 characters; null clears it.
replies_keywords
body · string
Services and towns, comma separated, up to 400 characters; null clears it.
photos_geotag
body · boolean
Photos going to Google carry a location.
geotag_lat
body · number
With geotag_lng; null clears the spot.
geotag_lng
body · number
With geotag_lat.
geotag_place
body · string
The spot's name, up to 200 characters (goes with geotag_lat and geotag_lng).
Request
cURL
curl -X PATCH "https://api.localflywheel.com/v1/google-business/profiles/PROFILE_ID" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"local_notes": "Most jobs are in Riverside and San Marco; salt air is hard on metal roofs.",
"photos_geotag": true
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/google-business/profiles/PROFILE_ID", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
local_notes: "Most jobs are in Riverside and San Marco; salt air is hard on metal roofs.",
photos_geotag: true,
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.patch(
"https://api.localflywheel.com/v1/google-business/profiles/PROFILE_ID",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"local_notes": "Most jobs are in Riverside and San Marco; salt air is hard on metal roofs.",
"photos_geotag": True,
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"profile": {
"id": "uuid",
"workspace_id": "uuid",
"local_notes": "Most jobs are in Riverside and San Marco; salt air is hard on metal roofs.",
"replies_keywords": null,
"photos_geotag": true,
"geotag_lat": null,
"geotag_lng": null,
"geotag_place": null,
"updated_at": "2026-11-08T15:00:00Z"
}
},
"error": null
}
Settings > Leads: the Facebook Pages connected to this sub-account so their Lead Form (Instant Form) leads arrive, and each Page's forms. A page's id is the connection (used by the routes below); page_id is Facebook's. Each form has connected (only a connected form makes leads), mapped (its questions were matched to lead fields in the app; without that, name, email and phone are recognised by themselves) and, for owners and admins, held_leads (leads Meta delivered for a form that isn't connected: they wait until the form is connected and a sync with include_unconnected imports them). import_unconnected_forms true = leads from forms that aren't connected are imported too. Any member of the sub-account. Never a Page token.
Connects a Facebook Page to this sub-account so its Lead Form leads arrive, exactly as Connect does in Settings > Leads. It needs a Facebook login already connected in the app (the person's own, else the sub-account owner's or the agency's) that fully manages the Page and has approved Lead Ads Retrieval: 409 with details.code otherwise (not_connected, missing_leads_retrieval, insufficient_page_admin...) and the words to act on. Connecting a Page does not connect its forms: turn forms on with PATCH /v1/meta-lead-forms/pages/{id}. The same Page can feed several sub-accounts. The agency's owner and admins only (the client's admins see the Pages read-only, as in the app).
Turns forms of a connected Page on or off (the switch on each form in Settings > Leads) and sets import_unconnected_forms. Only a connected form makes leads; from then on its new leads arrive like any live lead (alerts, the first text and automations, as the sub-account is set up). A form's field mapping, phone number and calendar set in the app are kept; matching a form's questions to lead fields stays in the app, and a form connected here without it still gets name, email and phone recognised. Only forms the Page is known to have (listed by GET /v1/meta-lead-forms) can be named. Owners and admins.
Parameter
Description
id
path · string · required
The connected Page's id (from GET /v1/meta-lead-forms; not Facebook's page_id).
forms
body · array
[{ form_id, connected: true | false, name? }], 1-200. name is kept only for a form that has none yet.
Disconnects the Page from this sub-account: its Lead Form leads stop arriving here and its form settings are removed. Leads already in the CRM stay. It works even when the Facebook login has expired. still_connected_elsewhere true means the same Page still feeds another sub-account. The agency's owner and admins only.
Parameter
Description
id
path · string · required
The connected Page's id (from GET /v1/meta-lead-forms).
Sync leads from Meta (Settings > Leads): pulls the last days of leads for the connected forms of the connected Pages (page_ids / form_ids narrow it; up to 2,000 leads a form) and answers 202 with a sync_id to follow at GET /v1/meta-lead-forms/syncs/{sync_id}. A lead that already exists (same Meta lead, phone or email) is updated, never duplicated; a lead deleted in the CRM comes back, because a sync asked for by hand is a re-import. Two switches decide who hears about the NEW leads, both off unless sent (in the app's dialog the first starts on): notify_team sends the sub-account's new-lead alerts (emails and texts to its notification recipients) for each one, the same as a live lead; run_automations gives each one exactly what a live lead gets: the first text and email (auto-greet), the AI's first message and Instant Lead Connect. Leave run_automations off for a backfill so old leads are never texted. Updated leads never alert anyone. include_unconnected also imports the leads held for forms that aren't connected. Owners and admins.
Parameter
Description
days
body · number
How far back, 1-365. Default 30.
page_ids
body · array
Only these connected Pages (Facebook's page ids). Default: all of them.
form_ids
body · array
Only these forms. Default: every connected form.
notify_team
body · boolean
Send the team's new-lead alerts for each new lead. Default false.
run_automations
body · boolean
Text and email each new lead like a live one. Default false.
include_unconnected
body · boolean
Also import leads held for forms that aren't connected. Default false.
A sync's status (running, completed or failed), forms_done of forms_total, how many leads were created, updated and skipped, and the same per form with the reason a form couldn't be read. Poll every couple of seconds while it is running. Any member of the sub-account.
Lead quality feedback: the dataset and recent events
GET/v1/lead-feedback
Read only
Settings > Leads > Lead quality feedback, read only: dataset_id (the Meta dataset lead stages are sent back to; null until one is made or picked in the app), enabled (the card's switch; nothing is sent without a dataset), the attached ad_account_ids, and recent_events: the newest events sent or failed (Lead, QualifiedLead, Schedule, Purchase, DisqualifiedLead) with the lead and Meta's reason for a failure. Making or picking a dataset, the step in Meta's Events Manager and sending test events stay in the app. Owners and admins.
Lead quality feedback: the datasets to choose from
GET/v1/lead-feedback/datasets
Read only
The Meta datasets on the sub-account's ad accounts, CRM ones first: id, name, is_crm (false = a website pixel), last_event_at, made_by_ad_account. ad_accounts carry own_dataset_id and can_create (Meta lets an ad account make one dataset this way; with one there, connect it instead). saved_dataset_id is the one lead stages go to now. suggested_dataset_id is set only when nothing is saved and there is exactly one CRM dataset; a website pixel is never suggested. problem says what stands in the way (Facebook not connected, no ad account picked). Owners and admins.
Lead quality feedback: make a CRM dataset and connect it
POST/v1/lead-feedback/datasets
Read and writeIdempotent
Makes a new dataset on one of the sub-account's ad accounts, saves it as where lead stages are sent, switches lead quality feedback on and sends Meta one event of each stage (Lead, QualifiedLead, Schedule, Purchase, DisqualifiedLead) for a made-up person, never a real lead, so they show in Events Manager. Meta treats it as a CRM dataset only after one step the person does in Events Manager (next_step, events_manager_url). 409 when that ad account already made its one dataset (details.own_dataset_id: connect it with PUT /v1/lead-feedback/dataset), when Meta refuses, or when another dataset is already saved and replace isn't true. Owners and admins.
Parameter
Description
ad_account_id
body · string
Which of the sub-account's ad accounts, like act_123456789. Default: its first.
name
body · string
The dataset's name in Meta, up to 60 characters. Default: "<business> CRM".
replace
body · boolean
Change the dataset that is already saved. Default false.
{
"success": true,
"data": {
"workspace_id": "uuid",
"dataset_id": "1234567890123456",
"name": "Castillo Roofing CRM",
"ad_account_id": "act_123456789",
"is_crm": false,
"events_received": 5,
"events_error": null,
"events_manager_url": "https://business.facebook.com/events_manager2/list/pixel/1234567890123456/overview?business_id=987654321",
"next_step": "Meta treats it as a CRM dataset only after one step in Events Manager: open the dataset > Set up Conversions API for CRM > Connect manually > Next. Read is_crm again afterwards."
},
"error": null
}
Saves a dataset the ad account already has (GET /v1/lead-feedback/datasets, or an id copied from Meta's Events Manager) as where lead stages are sent, switches lead quality feedback on and, unless send_events is false, sends one event of each stage for a made-up person. Answers is_crm (null for an id the connected logins can't list) and, for a website pixel, the step in Events Manager that makes it a CRM dataset. Pick a CRM dataset where there is one; never choose a website pixel for someone without asking. 409 when another dataset is already saved and replace isn't true. Owners and admins.
Parameter
Description
dataset_id
body · string · required
The dataset's id: 6 to 20 digits.
send_events
body · boolean
Send the setup events. Default true.
replace
body · boolean
Change the dataset that is already saved. Default false.
The Facebook Pages the connected Facebook login can connect to this sub-account: what the Page picker in Settings > Leads shows (the caller's own Facebook login, plus the Pages of the agency owner's). Each has page_id (what POST /v1/meta-lead-forms/pages takes), name, followers, has_instagram, shared_by (set when the Page comes from the agency owner's login), connected and id (this sub-account's connection, once connected). The list is the one saved when the Pages were last read; refresh=true starts reading them from Facebook again in the background and answers the saved list with refreshing true, so ask again in a minute. 409 not_connected when no Facebook login is connected, login_expired when it has run out, missing_permission when the login didn't allow Pages to be read. The agency's owner and admins only, as connecting a Page.
Parameter
Description
refresh
query · boolean
Read the Pages from Facebook again (in the background). Default false.
List a connected Page's Lead Forms with their questions
GET/v1/meta-lead-forms/pages/{id}/forms
Read only
A connected Page's active Lead Forms, read from Meta now, newest first: so a form made after the Page was connected is listed too. Each has form_id, name, created_at, connected (only a connected form makes leads), questions (key, label, type, field: the lead field its answer is saved to or null, suggested_field: what the app's mapper would pick), mapping (everything saved for the form), phone_number_id (the business number that texts its leads; null = the sub-account's default), calendar_id (the calendar they book on; null = automatic), imessage_line_id (set in the app) and held_leads (leads waiting because the form isn't connected). lead_fields lists what a question can be mapped to: the core lead fields and the sub-account's custom fields as custom:<field key>. 409 not_connected / login_expired / facebook_refused when Facebook can't be read with the connected login. Owners and admins.
Parameter
Description
id
path · string · required
The connected Page's id (from GET /v1/meta-lead-forms; not Facebook's page_id).
Set one Lead Form's mapping, phone number, calendar and switch
PATCH/v1/meta-lead-forms/pages/{id}/forms
Read and writeIdempotent
Changes what is saved for one Lead Form of a connected Page, as the form's editor in Settings > Leads does. mapping is the form's whole mapping, question key -> lead field (full_name, first_name, last_name, email, phone, address, city, state, zip, inquiry, or custom:<field key> for one of the sub-account's custom fields; null leaves a question unmapped): every key must be a question the form asks now (GET /v1/meta-lead-forms/pages/{id}/forms) or one already saved for it. phone_number_id is the business number that texts this form's leads and calendar_id the calendar they book on; both must be this sub-account's own, null goes back to the default. connected turns the form on or off (only a connected form makes leads; from then on its new leads arrive like any live lead). What isn't sent stays as it is; a form saved for the first time starts connected unless connected false is sent. A form made after the Page was connected can be named: it is looked up on Facebook first. The iMessage line a form texts from is set in the app. Owners and admins.
Parameter
Description
id
path · string · required
The connected Page's id (from GET /v1/meta-lead-forms; not Facebook's page_id).
form_id
body · string · required
The Lead Form's id (digits).
mapping
body · object
{ question key: lead field | null }: the form's whole mapping.
phone_number_id
body · string
One of the sub-account's phone numbers (GET /v1/phone-numbers), or null for its default.
calendar_id
body · string
One of the sub-account's active calendars (GET /v1/calendars), or null for automatic.
connected
body · boolean
Whether the form makes leads.
name
body · string
The name shown for the form, up to 200 characters.
A copy in the same sub-account: the draft, every extra page and file, per-page SEO, the page's settings and its database connection. The copy is a draft with a new link and no views, leads, custom domain, builds or waiting prompts. name is optional (default "<name> copy"); include_chat true also copies the builder chat. Answers copied { documents, seo, database, messages }. Up to 200 pages a sub-account. Copying into another sub-account stays in the app. People who manage the sub-account.
The page's history, newest first: version (its number), label, created_at, by { user_id, name }, document (which document that change was made to, / is the home page), prompt (the request behind a build, shortened), credits and restore_of (true when the version is itself a restore). Every build, edit, html write and restore makes one. People who manage the sub-account.
Puts a version back as the draft, exactly as Restore in the builder: the home page and every extra page that version held; pages made after it are removed, and files that version could not keep (left_alone) stay as they are. A version from before whole-project history puts back only the one document it kept. The restore is saved as a new version, so restoring the version before it undoes it. 409 while a build is running. Nothing goes live until POST /v1/smart-pages/{page_id}/publish. People who manage the sub-account.
Parameter
Description
page_id
path · string · required
Page id.
version
body · number · required
The version number from GET /v1/smart-pages/{page_id}/versions.
seo.pages: the home page (/) and each extra page with seo_title, seo_description and og_image_url. An extra page's empty field uses the home page's. People who manage the sub-account.
Changes only what is sent for the page at path (default /, the home page): seo_title (up to 300 characters), seo_description (up to 500), og_image_url (an https link). null clears a field. path must be a page that exists in this Smart Page (404 otherwise). Answers the same view as GET. People who manage the sub-account.
Drops every prompt waiting in line behind the running build (waiting in GET /v1/smart-pages/{page_id}/builds). The build that is running is not touched: POST /v1/smart-pages/{page_id}/cancel-build stops it. Answers cleared (how many). People who manage the sub-account.
paused true: prompts sent while paused, and the ones already waiting, stay in line. paused false: the queue runs again, and when nothing is building the next waiting prompt starts at once (started_build_id), costing credits like any build. Answers queue_paused, waiting and started_build_id. People who manage the sub-account.
The business's own database the page reads and writes, when one is connected in the builder: project_url, mode (anon: the page talks to it directly; server: through a proxy that holds the secret key), has_secret_key, tables [{ name, columns, allowed }], last_verified_at and last_error. database is null when none is connected. Its keys are never returned, and connecting or changing it stays in the app. People who manage the sub-account.
The forms on one document of the page (path, default / for the home page): form_id, name, connected (submissions reach the CRM as leads), fields (the names a visitor fills in) and what happens after it's sent: mode message (title, message, cta_label, cta_href; all null = the page's own thank-you card) or redirect. A document built before element ids existed gets them stamped on its draft first (attributes only, no new version), as the builder does when it opens, so every form and element can be addressed. People who manage the sub-account.
mode message: a thank-you card with title (up to 120 characters), message (up to 600) and an optional button (cta_label up to 60, cta_href: a page in the project like /book, or an https:// link); leave them all out to go back to the page's own card. mode redirect: send the visitor to a page in this project (redirect, like /thank-you); never another site. Saved to the draft as a free version (no AI, no credits); POST /v1/smart-pages/{page_id}/publish puts it live. 409 when the form is no longer on the page. People who manage the sub-account.
Parameter
Description
page_id
path · string · required
Page id.
path
body · string
Which document (default /).
form_id
body · string · required
The form (form_id from GET .../forms).
mode
body · string · required
What happens after it's sent.
One of: message, redirect
title
body · string
message: the card's title.
message
body · string
message: the card's words.
cta_label
body · string
message: a button on the card.
cta_href
body · string
message: where the button goes (/page or https://...).
redirect
body · string
redirect: the page to send visitors to, like /thank-you.
Request
cURL
curl -X PUT "https://api.localflywheel.com/v1/smart-pages/PAGE_ID/forms" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"form_id": "form-1",
"mode": "message",
"title": "Thanks!",
"message": "We'\''ll call you within the hour.",
"cta_label": "Book a time now",
"cta_href": "/book"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/smart-pages/PAGE_ID/forms", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
form_id: "form-1",
mode: "message",
title: "Thanks!",
message: "We'll call you within the hour.",
cta_label: "Book a time now",
cta_href: "/book",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.put(
"https://api.localflywheel.com/v1/smart-pages/PAGE_ID/forms",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"form_id": "form-1",
"mode": "message",
"title": "Thanks!",
"message": "We'll call you within the hour.",
"cta_label": "Book a time now",
"cta_href": "/book",
},
)
print(res.json())
The builder's inline edit: replaces the text of up to 100 elements by id in one free version (no AI, no credits). Each edit takes element_id (the element's data-zu-id in the page's HTML: GET /v1/smart-pages/{page_id}?include=html) and text (plain words) or html (words with inline markup such as <strong> or <br>; scripts, styles, forms, embeds and event handlers are refused). All or nothing: 409 when an element is no longer on the page. People who manage the sub-account.
Parameter
Description
page_id
path · string · required
Page id.
path
body · string
Which document (default /).
edits
body · array · required
1-100: [{ element_id, text | html, label? }]. label names the element in the version list.
The builder's Style panel on one element: styles sets any of color, background-color (hex, rgb(), hsl(), transparent), font-size, padding, border-radius (px, rem, em or %), font-weight (100-900, normal, bold), text-align (left, center, right, justify); "" puts the page's own style back. Or remove: true takes the element off the page. One free version (no AI, no credits). 409 when a value isn't valid or the element is gone. People who manage the sub-account.
Put a Smart Page on its own domain, or back on its shared link
PATCH/v1/smart-pages/{id}/domain
Read and writeIdempotent
Sets which of the sub-account's own domains opens this Smart Page (the builder's Address & domain): domain_id must be a verified domain of the same sub-account (GET /v1/smart-forms/domains; 409 domain_not_verified otherwise), or null for the shared link. A domain opens one Smart Page: when another page has it the call is refused with 409 domain_in_use and that page's id, unless move true is sent, which moves the domain here and puts the other page back on its shared link (moved_from). The answer has public_url (where the page opens now) and shared_url (which keeps working either way). People who manage the sub-account.
Parameter
Description
id
path · string · required
The Smart Page's id.
domain_id
body · string · required
A verified domain's id, or null for the shared link.
move
body · boolean
Take the domain from the page that has it now. Default false.
The sub-account's Smart Pages: landing pages and small websites with lead capture, built by an AI builder and hosted on the business's own domain. Each has status (draft | published), live, public_url, views, leads, building (queued | running | awaiting_approval | null) and builder (the page in the app). People who manage the sub-account.
Makes a page. With brief, the AI builder starts building it at once (usually 2-6 minutes; watch GET /v1/smart-pages/{page_id}/builds): write it like a brief for a designer: the business, the offer, who it's for, the sections wanted, the style and colors, the phone number, and what the form should ask. Without brief the page is empty until POST /v1/smart-pages/{page_id}/edit or PUT /v1/smart-pages/{page_id}/html. A build costs credits like in the app (charged to the account that pays for the sub-account, when the build finishes); 402 when it is out of credits. model: claude-opus-5-5 (default, the design model) or glm-5.3-flash. A new page is a draft: publish it when it's ready. People who manage the sub-account.
Parameter
Description
name
body · string
The page's name (also starts its link).
brief
body · string
What to build, 20-20,000 characters. Starts the AI builder.
model
body · string
claude-opus-5-5 or glm-5.3-flash.
One of: claude-opus-5-5, glm-5.3-flash
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/smart-pages" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"name": "Roof repair Dallas",
"brief": "A landing page for Castillo Roofing in Dallas, TX. Offer: free roof inspection after hail. For homeowners. Sections: hero with the offer and a short form (name, phone, address), why us, how it works in 3 steps, service area, FAQ. Navy and orange, bold and trustworthy. Phone (214) 555-0142."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/smart-pages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
name: "Roof repair Dallas",
brief: "A landing page for Castillo Roofing in Dallas, TX. Offer: free roof inspection after hail. For homeowners. Sections: hero with the offer and a short form (name, phone, address), why us, how it works in 3 steps, service area, FAQ. Navy and orange, bold and trustworthy. Phone (214) 555-0142.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/smart-pages",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"name": "Roof repair Dallas",
"brief": "A landing page for Castillo Roofing in Dallas, TX. Offer: free roof inspection after hail. For homeowners. Sections: hero with the offer and a short form (name, phone, address), why us, how it works in 3 steps, service area, FAQ. Navy and orange, bold and trustworthy. Phone (214) 555-0142.",
},
)
print(res.json())
One page: its settings, link, numbers, built (false until a first build or html), unpublished_changes, documents (the home page "/" and every extra page or file such as /thank-you or /robots.txt, with sizes) and latest_build. include=html adds html { path, content }: the draft of the home page, or of path. People who manage the sub-account.
name, slug (the end of its link: 3-60 lowercase letters, numbers and dashes; changing it changes a published page's address), seo_title, seo_description, favicon_url and og_image_url (https links; null clears). What is on the page changes with POST /v1/smart-pages/{page_id}/edit or PUT /v1/smart-pages/{page_id}/html. A custom domain is connected in the app.
Sends the page's AI builder a request in plain words, as typing in the builder's chat does: content, design, new sections, extra pages ("add a /thank-you page"), forms, anything. mode build (default) makes the change; plan writes a plan first and waits (the build's status is awaiting_approval and plan holds it: send approve_build_id with that build's id to build it); chat answers a question without changing the page. path is the document the request is about (default /, the home page). attachments are up to 4 https pictures to use or copy. One build runs per page at a time: a request sent meanwhile waits in line (queued: true) and starts by itself. Answers 202 with build_id; GET /v1/smart-pages/{page_id}/builds shows when it is done. Costs credits like in the app; 402 when out of credits. Nothing goes live until the page is published.
Parameter
Description
page_id
path · string · required
Page id.
prompt
body · string
What to change or build, up to 20,000 characters. Required unless approve_build_id is sent.
mode
body · string
build (default), plan or chat.
One of: build, plan, chat
path
body · string
The document it's about (default /).
attachments
body · array
Up to 4 https picture links.
approve_build_id
body · string
Build a plan that is waiting for approval.
model
body · string
claude-opus-5-5 or glm-5.3-flash (default: the page's).
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/smart-pages/PAGE_ID/edit" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"prompt": "Make the hero headline '\''Hail damage? Free roof inspection this week'\'' and add a section with three customer reviews above the FAQ."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/smart-pages/PAGE_ID/edit", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
prompt: "Make the hero headline 'Hail damage? Free roof inspection this week' and add a section with three customer reviews above the FAQ.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/smart-pages/PAGE_ID/edit",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"prompt": "Make the hero headline 'Hail damage? Free roof inspection this week' and add a section with three customer reviews above the FAQ.",
},
)
print(res.json())
Response 202
JSON
{
"success": true,
"data": {
"build_id": "uuid",
"queued": false,
"note": "The builder is working. GET /v1/smart-pages/{id}/builds shows when it is done (usually 1-5 minutes)."
},
"error": null
}
The last 15 builds (status queued | running | awaiting_approval | done | failed | canceled, stage while running, plan for a plan, error when it failed), the requests waiting in line, queue_paused, and the builder's last messages (what it said it changed, or its answer to a chat).
Replaces one document's draft with html you wrote: the home page (path /, default) or an extra page or file (path /thank-you, /services/roofing, /robots.txt, /sitemap.xml; a path that doesn't exist yet is created, up to 60). A page must be a whole document (<!doctype html> ... </body></html>), up to 1,500,000 characters. To edit what's there, read it first with GET /v1/smart-pages/{page_id}?include=html. Free. Saved as a version (label names it in the builder's history), so Restore in the builder can undo it. Refused (409) while a build is running on the page. Lead forms on the page keep working when they keep the builder's own form markup. Nothing goes live until the page is published.
Settings > Branding: the logo (also the browser icon), the home-screen app icon, whether the sub-account has its own installable app and its name, the CRM's own name, accent colour and hide-logo switch, and the sign-in page on the business's own domain (headline, text, color, image_url). agency_only lists the fields only the agency side may change. Any member of the sub-account.
Changes only what is sent; everything else about the brand is kept. logo_url is also saved as the browser icon and as the sub-account's logo on lists, invoices and contracts; null removes it (and the app icon with it). Links must be public https links. app_install_enabled, app_name, brand_name, accent_color and hide_logo are the agency's: a client admin gets 403 on them. Owners and admins.
Parameter
Description
logo_url
body · string
Logo, an https link (null removes it).
app_icon_url
body · string
The square home-screen icon, an https link. Needs a logo.
sign_in_page
body · object
{ headline (80), text (240), color (hex), image_url (https) }: any of them; null clears one.
app_install_enabled
body · boolean
Agency only: the sub-account gets its own Add to Home Screen app.
app_name
body · string
Agency only: that app's name, up to 40 characters.
brand_name
body · string
Agency only: the name the CRM shows for this sub-account, up to 60 characters.
The custom links in a sub-account's CRM menu: agency_items (the agency's, shown in every sub-account, read only here) and items (the sub-account's own), each { id, label, kind (link | code), url, mode (embed | new_tab | same_tab), icon, audience (everyone | admins) } and, for kind code, the pasted embed code. Links for admins only are left out for staff. Any member of the sub-account.
Replaces the sub-account's own menu links (the agency's stay). Up to 12 items, each { label (up to 40 characters), url } for a link (http or https; it may use {workspace_id}, {workspace_name}, {user_email}, {user_name}) or { label, kind: "code", code } for pasted embed code (up to 20,000 characters, always shown as its own page). Optional: id (kept so a link's address stays the same), mode (embed (default) | new_tab | same_tab), icon (favicon (default), link, globe, layout, chart, file, folder, video, book, calendar, chat, cart, star, wrench, briefcase, graduation, or lucide:<IconName>), audience (everyone (default) | admins). An empty list removes them all. Owners and admins.
The tools a sub-account connected in Settings > Integrations: provider, connected, sends_new_leads and sends_appointments (it gets them by itself), leads_arrive_as, tags, source_name, reads_status_changes, reads_revenue, last_error. Never a key. Connecting a tool or changing its key is done in the app. People who manage the sub-account.
The sub-account's own sending domains (Settings > Email): verified, is_default, and dns_records { dkim, return_path, dmarc }, each { type, host, value, verified }: the records to add at the domain's registrar. People who manage the sub-account.
Registers a domain for sending the sub-account's emails and answers the DNS records to add. The first one becomes the default. 409 when the domain is already set up, here or in another account. People who manage the sub-account.
Looks the DNS records up again and answers the domain with each record's verified. Emails go from the domain once it is verified. DNS changes can take from a few minutes to an hour. People who manage the sub-account.
The sub-account's Support tickets, newest activity first: subject, category, status (open, answered, resolved), who is answering (the assistant or the team), unread state and rating. The agency team sees every ticket; a client admin every ticket of the sub-account; anyone else their own. 403 feature_off while Support is off for the sub-account.
What the sub-account's Support page does: the ticket goes to the account's support team, their AI assistant answers first (usually within a minute; read the ticket for the answer) and hands it to a person when it can't solve it. Replies also arrive by email. Any member of the sub-account; at most 5 new tickets an hour per person. Files are added in the app. 403 feature_off while Support is off for the sub-account.
Parameter
Description
message
body · string · required
What is going on (2-20,000 characters).
subject
body · string
Up to 160 characters. Default: the start of the message.
topic
body · string
Default question.
One of: question, problem, billing, request, ads, other
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/support/tickets" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"subject": "Texts not sending",
"message": "Since this morning our texts to new leads fail. We changed nothing.",
"topic": "problem"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/support/tickets", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
subject: "Texts not sending",
message: "Since this morning our texts to new leads fail. We changed nothing.",
topic: "problem",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/support/tickets",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"subject": "Texts not sending",
"message": "Since this morning our texts to new leads fail. We changed nothing.",
"topic": "problem",
},
)
print(res.json())
A new message on a ticket the key's person opened (a client admin: any of the sub-account's tickets), as on the Support page. While the assistant handles the ticket it answers again; otherwise the team is told. answered_by says which. The support team answers with POST /v1/support/tickets/{ticket_id}/reply instead (403 here).
Parameter
Description
ticket_id
path · string · required
Ticket id.
message
body · string · required
Up to 20,000 characters.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/support/tickets/TICKET_ID/messages" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"message": "Still failing after the restart."
}'
The support team's reply, as from the Support desk: it shows on the client's Support page, is emailed to them (emailed says whether it went) and pushed to their phone. A reply still holding [check: ...] parts (from the assistant's suggested reply) is refused until they are filled in. The agency's owners and team only; others get 403.
Parameter
Description
ticket_id
path · string · required
Ticket id.
body
body · string · required
The reply, up to 20,000 characters.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/support/tickets/TICKET_ID/reply" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"body": "Thanks Pat, your texting number was paused by the carrier. We'\''ve fixed it; texts are going out again."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/support/tickets/TICKET_ID/reply", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
body: "Thanks Pat, your texting number was paused by the carrier. We've fixed it; texts are going out again.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/support/tickets/TICKET_ID/reply",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"body": "Thanks Pat, your texting number was paused by the carrier. We've fixed it; texts are going out again.",
},
)
print(res.json())
A note on the ticket only the support team sees; the client is not told. The agency's owners and team only.
Parameter
Description
ticket_id
path · string · required
Ticket id.
body
body · string · required
The note, up to 20,000 characters.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/support/tickets/TICKET_ID/notes" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"body": "Carrier flagged the number on 10-28. Asked them to lift it."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/support/tickets/TICKET_ID/notes", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
body: "Carrier flagged the number on 10-28. Asked them to lift it.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/support/tickets/TICKET_ID/notes",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"body": "Carrier flagged the number on 10-28. Asked them to lift it.",
},
)
print(res.json())
Status, priority, assignee, who answers (support team)
PATCH/v1/support/tickets/{ticket_id}
Read and writeIdempotent
The Support desk's changes, applied in this order: assigned_to (a team member's user id who can open the sub-account, or null to unassign; the new assignee is emailed and pushed the ticket), priority, handler (staff: the team answers from now on; assistant: hand it back, and the assistant answers at once if the client is waiting), status (resolved, or open to reopen). If one fails, the ones before it stay. Returns the ticket. The agency's owners and team only.
Parameter
Description
ticket_id
path · string · required
Ticket id.
status
body · string
resolved closes it; open reopens it.
One of: open, resolved
priority
body · string
Set by hand, it stays even when the assistant suggests another.
What this key may do and how much of it is used: access_level (read / write / admin / custom) and scopes, the workspace it is locked to (if any), rate_limit_per_min, credit_budget (limit, used, remaining and reset date; null when the key has no budget) and usage_30d (requests, errors, rate_limited). type is account (made in Settings → API) or sub_account (made in a sub-account's own Settings → API in the client CRM), and endpoints gives the API and MCP addresses for the host you called. A sub-account key can call this.
Click fraud: the protection score, invalid clicks, what they cost, blocked addresses
GET/v1/click-guard
Read only
From the Website Analytics line on the sub-account's website, which watches every visit from its Google and Meta ads (robots included). protection is 0-100 with items (what's done, what's missing); totals and period_before hold clicks, valid, suspicious, invalid, accidental, ignored (the ad platforms' own checkers), converted, invalid_cost (invalid clicks x the account's own cost per click from Google Ads, else the owner's manual_cpc), blocked_now and blocked_new. savings: wasted, perMonth (that rate for 30 days), realClicks and leads that money buys at the account's conversion rate. why_invalid groups clicks by their main reason (repeat, robot, hidden = servers / VPNs / Tor, area, competitor, farm, accidental); by_day, breakdowns (campaign, keyword, country, region, city, device, network, platform, browser), latest_invalid, google_ads (campaigns, cost per click, Google's own invalid clicks it didn't charge for, last sync and coverage), meta, setup and settings. Owners and admins.
Ad clicks, newest first, with each one's score and reasons
GET/v1/click-guard/clicks
Read only
Every ad click that reached the website: verdict (valid, suspicious, invalid, ignored), score 0-100, reasons (code, points, detail), category, ip (erased after 90 days), network (home, mobile, datacenter, vpn, relay), isp, place, device, campaign and keyword (from Google Ads), landing page, seconds on the page, cost, blocked, converted. 50 a page.
Parameter
Description
days
query · number
How many days back, 1-400 (default 30).
verdict
query · string
invalid, suspicious, valid or ignored.
search
query · string
Starts of an IP address, or words in the city, network, campaign or keyword.
One ad click in full, with the address's other clicks
GET/v1/click-guard/clicks/{click_id}
Read only
What the browser said (automated or not, time zone, screen), what the visitor did (time on the page, scroll, moves, taps, first action), every reason with its points, the address's block (status, expires_at, in_google), and up to 30 other clicks from the same address or device.
active (kept out of the ads: why, clicks, cost, place, network, in_google, expires_at), allowed (never blocked) and the last 100 expired. A block lasts 30 days after the last bad click (90 for servers and VPNs, 7 for phone networks); a block made by hand lasts until it's unblocked.
Adds an address (203.0.113.7) or a CIDR range (203.0.113.0/24) to the block list; with automatic blocking on and Google Ads connected it reaches the account's IP exclusions within minutes. 409 when it's on the never-block list.
Unblock an address (and optionally never block it again)
POST/v1/click-guard/unblock
Read and writeIdempotent
Takes the address off the block list (and out of Google Ads with the next sync). never: true also puts it on the never-block list and scores its recent clicks again.
Automatic blocking, how strict, the click limit, servers, VPNs, countries, never-block list
PATCH/v1/click-guard/settings
Read and writeIdempotent
Any of: enabled, auto_block (block in Google Ads by itself), sensitivity (relaxed, standard, strict), click_limit (0-20; 0 = no limit) and click_limit_days (1-30), block_servers, block_vpn, countries (ISO codes served; empty = the business's own), allow_ips (never block), meta_leads (check leads from the ads for fakes), manual_cpc (your cost per click, used only without Google Ads). A rule change scores the last 7 days' clicks again.
Parameter
Description
enabled
body · boolean
Turn Click Guard on or off for the sub-account.
meta_leads
body · boolean
Check leads from the ads for fakes and keep them out of what Meta and Google learn from. Default true.
Reads the Google Ads account (campaigns, cost per click, Google's invalid clicks) and adds or removes Click Guard's addresses: the account-wide list first (every campaign type, Performance Max included, 500 at most), then each Search, Display and Shopping campaign's own list. The business's own exclusions are never touched. Answers added, removed and coverage. It also runs by itself every few minutes.
Answered from the business's own clicks, blocks and costs (never made up), with buttons into the tool and next questions. Pass chat_id back to continue a conversation. 40 questions a day per person.
The same line as Website Analytics (a site that has it needs nothing more), whether it's on the site, and the setup steps. Turns Click Guard on for the sub-account.
Every lead from the sub-account's ads is checked a few minutes after it comes in: a Meta Instant Form lead from what it says (made-up names, numbers and emails, test entries, numbers that don't exist), a form or booking from the ad click its visit came from. verdict junk = fake (a fake Instant Form lead is reported to Meta as DisqualifiedLead through Lead quality feedback; a form from a fake ad click is never sent to Meta), doubt = only marked. meta: told | held | no_dataset (Lead quality feedback off). Nothing is hidden or deleted. Owners and admins.
Parameter
Description
days
query · number
How many days back, 1-400 (default 30).
verdict
query · string
junk (only fake) or all (every checked lead). Default: fake and doubtful.
Read only: the sub-account's active Meta ad sets that show ads inside other apps and sites (Audience Network), where accidental taps and junk clicks pile up. Needs Meta connected in Ad Insights.
Turn off Audience Network in the Meta ad sets (or undo it)
POST/v1/click-guard/meta-cleanup
Read and writeIdempotent
Takes Audience Network out of every active ad set that shows there, keeping everything else; the ads keep running on Facebook, Instagram and Messenger. Each ad set's earlier placements are kept, so undo: true puts them back. Meta may review a changed ad set again (usually under a day).
Which Google campaigns show where junk clicks pile up
GET/v1/click-guard/google-cleanup
Read only
Read only: the sub-account's Google Ads campaigns (on or paused) with search partners on, the Display Network on a Search campaign, or ads shown to people only interested in the area (not in it), with what the clean-up would change in each. Performance Max is left alone. Needs Google Ads connected.
Turns search partners and the Display Network off on Search campaigns and shows the ads only to people in the targeted places, through the account's Google Ads change history (one row per kind of change, each with its own undo). undo: true puts every campaign back as it was; Google Ads History's own Undo does the same.
Calls from tracking numbers: where they came from, answered, good leads, revenue
GET/v1/call-tracking
Read only
Tracking numbers show which ad, campaign, keyword and page made the phone ring: each website visitor sees their own number from a pool (the Website Analytics line swaps it), and a Google profile, flyer or truck gets a number each. totals (calls, prev_calls for the period before, first_time, answered, missed, voicemail, qualified = good leads + booked, booked, avg_seconds, missed_from_ads = callers from ads nobody answered or called back, leads, revenue_cents from callers whose jobs were won), series (per day), series_by_channel, channels, sources, campaigns, keywords, pages (landing pages), numbers, hours (weekday x hour, calls and missed), recent (the newest calls), pool (website numbers: size, in_use now, visits and shared = visits that had to share a number) and insights. Owners and admins.
Tracked calls, newest first, with where each came from and the AI's read
GET/v1/call-tracking/calls
Read only
Each call: id, at, from, name (the lead's or the one the caller said), status, duration, voicemail, recording (true when there is one), tracking_number and number_name, kind (pool = a website number, source = one place's number), matched (visit, shared, none, source), channel, source, campaign, keyword, landing, first_time, label (the person's) and ai_label, summary, score (0-100 chance of becoming a customer), topic, value_cents, won, called_back, lead_id and session_id (the website visit).
Parameter
Description
days
query · number
How many days back, 1-400 (default 30).
status
query · string
answered, missed, voicemail or not_called_back.
label
query · string
qualified (good leads and booked), booked, quote, customer, not_a_fit, vendor, spam, voicemail or unknown.
channel
query · string
e.g. Paid search, Paid social, Organic search, Google Business Profile, Offline.
One tracked call in full: the visit, the recording, transcript and the AI's read
GET/v1/call-tracking/calls/{call_id}
Read only
Everything in the list, plus recording_url, transcript (lines by caller c / business b, written by a speech-to-text model; the AI reads only that, never the audio), next_step, amount (a price said on the call), the lead, the website visit (source, campaign, device, place, time on the site) with its pages in order, and the caller's other calls.
Mark what kind of call it was, or what it was worth
PATCH/v1/call-tracking/calls/{call_id}
Read and writeIdempotent
label wins over the AI's (null goes back to it). A call marked spam is given back: its talk time, recording and AI credits are refunded, up to 50 calls a month per sub-account.
The tracking numbers, the settings, and how many website numbers the traffic needs
GET/v1/call-tracking/numbers
Read only
numbers (phone_number, kind pool | source, name, preset, carrier, bought_at, paid_until), settings, pool_advice (recommended, why, measured: sized from the site's real traffic), traffic (visits a day, the busy-time number of visitors at once, the share from ads) and prices (credits: number_monthly, per_leg_minute, recording_per_minute, ai_per_minute).
Add website numbers or a number for one place (spends credits)
POST/v1/call-tracking/numbers
Read and writeUses creditsIdempotent
kind pool adds count (1-10) website numbers; kind source adds one number for one place (preset gbp, google_lsa, yelp, angi, nextdoor, facebook_page, flyer, direct_mail, vehicle, yard_sign, billboard, radio, tv, print, email, other; name). Local numbers in area_code (else the sub-account's), bought on the carrier of the line calls ring like. Voice only: they never text, so they need no texting registration. 15 credits a number a month, the first month now; 402 when the credits aren't there.
Where calls ring, recording, which numbers the website swaps, for whom
PATCH/v1/call-tracking/settings
Read and writeIdempotent
route line (rings like line_number: the apps, ring order, AI receptionist, voicemail and missed-call text, as a call to it would) or forward (to forward_to, with caller_id caller | tracking and whisper: the person answering hears the source first). record + greeting (played to every caller before the call when recorded), ai (read recorded calls), swap_numbers (numbers on the site to replace), who (all, ads, not_direct), hold_minutes (10-120: how long a visitor keeps their number after their last activity), area_code, google_ads (a caller from a Google ad gets that click on their lead, so booked and won jobs count in Google Ads) and enabled (false stops swapping; the numbers keep ringing).
The settings (as PATCH /v1/call-tracking/settings) plus pool_size: buys the website numbers that are missing (up to 10 at a time; see pool_advice) and turns swapping on. Spends 15 credits a number for its first month.
A sub-account's reports, with their email schedules and alerts
GET/v1/reports
Read only
Every saved report: name, what it covers (sources), its dates, the share link when on, its scheduled emails (describe says when, next_run_at the next one) and alerts. Owners and admins. 403 feature_off for a client when the agency hides Reports.
What a report can show here: connected sources, team emails, ready-made reports
GET/v1/reports/catalog
Read only
connected says which sources have data to show in this sub-account (Meta and Google Ads need Ad Insights, the Google profile needs Tools, rankings need a Map Rankings scan); team lists people to send to; templates are the ready-made reports (POST /v1/reports with template). The metric keys, splits and tables themselves are in the API docs and MCP tool reports (action catalog).
Make a report: ask for it in words, start from a ready-made one, or send its blocks
POST/v1/reports
Read and writeIdempotent
prompt: the AI builds it from plain words ("a monthly report on leads and cost per lead, emailed to me on the 1st") and saves it, plus its email schedule and alerts when the words ask for them (with_schedule false to skip); the answer has its reply. template: a ready-made report (GET /v1/reports/catalog). doc: your own blocks. The report: {range: {preset}, compare: previous | year | none, blocks: [...]}. Block types: kpis {metrics}, chart {metrics, view: area | line | bar, group: auto | day | week | month}, breakdown {metric, by, view: bar | donut | table, limit}, table {table, limit}, funnel, summary {focus}, heading {text, sub}, text {text}; any block takes title and width (full | half). Metric keys, splits and tables: GET /v1/reports/catalog. Unknown keys are dropped. Owners and admins.
Parameter
Description
prompt
body · string
What to build, in plain words. The AI picks the numbers, charts and dates.
prompt only: false = don't set up the emails it asked for.
Request
cURL
curl -X POST "https://api.localflywheel.com/v1/reports" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"prompt": "How are my Facebook and Google ads doing? Cost per lead and cost per sale by campaign. Email it to me every Monday."
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/reports", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
prompt: "How are my Facebook and Google ads doing? Cost per lead and cost per sale by campaign. Email it to me every Monday.",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.post(
"https://api.localflywheel.com/v1/reports",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"prompt": "How are my Facebook and Google ads doing? Cost per lead and cost per sale by campaign. Email it to me every Monday.",
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"reply": "I built \"Ads performance\" and set it to email you every Monday at 8:00 AM.",
"report": {
"id": "uuid",
"name": "Ads performance",
"sources": [
"leads",
"meta",
"google_ads",
"ads"
]
},
"schedules": [
{
"id": "uuid",
"describe": "Every Monday at 8:00 AM",
"recipients": [
"owner@acme.com"
]
}
],
"alerts": []
},
"error": null
}
One report: its blocks, schedules, alerts and the emails it sent
GET/v1/reports/{report_id}
Read only
sends are the last 25 emails (scheduled, sent now, tests, alerts) with when they went out and were opened; url is the frozen web copy that email links to. Owners and admins.
Send name, description or doc (the whole doc replaces it), or prompt to have the AI change it ("add Google Ads spend", "show it by week", "email it monthly"): it keeps what you didn't ask to change. Shows on the page at once. Owners and admins.
Parameter
Description
report_id
path · string · required
Report id (GET /v1/reports).
prompt
body · string
The change, in plain words.
doc
body · object
The whole report (see POST /v1/reports).
name
body · string
Up to 120 characters.
description
body · string
One line.
Request
cURL
curl -X PATCH "https://api.localflywheel.com/v1/reports/REPORT_ID" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"prompt": "Add Google Ads spend and cost per conversion under the Meta numbers"
}'
JavaScript
const res = await fetch("https://api.localflywheel.com/v1/reports/REPORT_ID", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
prompt: "Add Google Ads spend and cost per conversion under the Meta numbers",
}),
});
const { success, data, error } = await res.json();
Python
import os
import uuid
import requests
res = requests.patch(
"https://api.localflywheel.com/v1/reports/REPORT_ID",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"prompt": "Add Google Ads spend and cost per conversion under the Meta numbers",
},
)
print(res.json())
Response 200
JSON
{
"success": true,
"data": {
"reply": "Added Google Ads spend and cost per conversion under the Meta numbers.",
"report": {
"id": "uuid",
"name": "Ads performance"
},
"schedules": [],
"alerts": []
},
"error": null
}
values: metric -> [this period, compared period]; series: metric -> one value per day; breakdowns: metric|split -> rows; tables; summaries (the AI summary per summary block, summaries=false to skip); sources says why a source has nothing (not_connected, error, no_data). Money is in the account's currency, percents are fractions (0.25 = 25%), speed in minutes. Leads leave out imported lists, spam, existing customers and chat-only people. Meta, Google Ads and Google profile numbers are read live (Google's run about 3 days behind). Owners and admins.
Parameter
Description
report_id
path · string · required
Report id (GET /v1/reports).
preset
query · string
Other dates: last_7_days, last_30_days, this_month, last_month, last_quarter, this_year, custom ... (the report's own when left out).
Freezes the numbers for the report's dates (or range) and emails them in the agency's brand: format {summary: the numbers in the email, pdf: attached, link: to the web copy}. test: true sends only to the key's person. At most 60 a day per sub-account. Owners and admins.
Parameter
Description
report_id
path · string · required
Report id (GET /v1/reports).
recipients
body · array
Email addresses (up to 25).
test
body · boolean
Send only to yourself.
format
body · object
{summary, pdf, link}, booleans.
message
body · string
A note at the top.
subject
body · string
{period} becomes the dates.
range
body · object
Other dates than the report's own: { preset, from, to } as GET .../data takes them.
Turn a report's share link on or off, or make a new one
PUT/v1/reports/{report_id}/share
Read and writeIdempotent
Anyone with the link sees the report with live numbers and can pick other dates, without signing in. new_link: true makes the old link stop working. Owners and admins.
Email a report every day, week, two weeks, month or quarter
POST/v1/reports/{report_id}/schedules
Read and writeIdempotent
frequency daily | weekly | biweekly | monthly | quarterly; day_of_week 0-6 (0 = Sunday), day_of_month 1-28, hour 0-23, minute 0 | 15 | 30 | 45, in timezone (the sub-account's when left out). period schedule (default) covers the days before each email (the week before, the month before ...), report uses the report's own dates. format {summary, pdf, link}. Send id to change one. Up to 10 per report. Owners and admins.
metric (a report metric key), op above | below, threshold (money in the account's currency, percents as fractions, speed in minutes), window day | week | month (yesterday, the last 7 or 30 days). Checked every morning after 7 AM in the sub-account's time zone; emails once when it crosses, again only after it comes back. Send id to change one. Up to 20 per sub-account. Owners and admins.
The sub-account's loyalty programs, newest first, with their settings, design, join link (the QR code on the counter) and 30-day numbers: cards, active, invited, in_apple, in_google, joined_30d, visits_30d, earned_30d, rewards_ready, rewards_used_30d, spend_30d, returning_30d. problems lists what must be fixed before a draft can go live. wallets says whether Apple Wallet and Google Wallet passes are on. Free.
The kinds of card (stamps, points, cashback, tiers, membership, multipass, coupon, gift, event) with what each suits, and the starters (a ready card for a coffee shop, salon, car wash, auto repair, home services, pet groomer, gym, spa, bakery, pizza, shop, a one-time offer, gift cards) to pass as starter to POST /v1/loyalty-cards.
A new draft: starter (from the catalog: its rules and look, in the business's logo), or kind with optional settings and design (missing fields take the kind's defaults). Turn it on with PATCH status live. Words about reviews or ratings are refused.
Parameter
Description
starter
body · string
A starter key from GET /v1/loyalty-cards/catalog.
kind
body · string
stamps, points, cashback, tiers, membership, multipass, coupon, gift or event.
settings
body · object
Rules: language (en, fr, es, de, nl, pt-BR, pt, zh: what customers read; a starter's words come in it), name, headline, goal, rewards [{ at, label, detail }], earn { per: visit | spend, spendCents, points }, cashbackPercent, tiers, perks, validMonths, offer, event, welcome, referral, birthday, winback, auto { invoicePaid, jobWon, appointmentDone, stripePaid, issue }, message (must hold {link}), maxPerDay, rewardDays, terms.
Only what's sent: settings and design are merged into the saved ones, status is draft, live, paused or ended (live refuses a program that isn't ready and says why). Every card already in a wallet updates by itself within a minute.
For a lead in the CRM (lead_id) or someone new (contact: firstName, phone, email; matched to a lead first). channel sms or email sends them their card's link right away (texts cost the usual text price). A person who already has the card gets theirs back (created false).
People and balances from another loyalty app, up to 100 a call: { name, phone?, email?, stamps?, points?, balance_cents?, visits_left?, visits?, birthday? (MM-DD) }. Saved as customers with a card that isn't sent; send them later with POST .../send audience unsent.
How many people POST .../send would reach (free, sends nothing): audience past_customers, recent (90 days), everyone, tagged (tag_ids) or unsent (cards made but never sent), channel sms or email. People who already have the card, opted out or can't get that channel are left out.
Parameter
Description
program_id
path · string · required
A loyalty program (from GET /v1/loyalty-cards).
audience
body · string · required
past_customers, recent, everyone, tagged or unsent.
Each person in the audience gets their own card, already filled in, by text or email, spread over the business's sending hours at the recommended pace (or pace { n, per: hour | day }), never past the daily texting limit. Up to 2,000 a send. Turns a draft program live when it's ready.
body (up to 240 characters) shows on the lock screen of everyone whose card is in Apple Wallet or Google Wallet, and on browsers that turned notifications on on their card page (both free); channel wallet_then_text also texts the rest, if they agreed to texts. audience all, active, quiet, ready (a reward waiting), close (one or two stamps away) or new. One a day per program; send_at schedules it.
The card with its balance, what it shows (face: headline, fields, the nudge like "2 more stamps to a free coffee"), rewards ready to use, every reward, and its history (each entry's id is what undo takes).
Parameter
Description
card_id
path · string · required
A customer's card (from .../members or GET /v1/loyalty-members).
Stamps (one per visit, or per amount spent), points, cashback credit, a VIP level's spend or a membership check-in, by the program's rules; count gives stamps or points by hand. A milestone gives its reward and the card's phone shows it. ref (your order or receipt id) never counts twice. Refused past the program's daily limit per card.
Parameter
Description
card_id
path · string · required
A customer's card (from .../members or GET /v1/loyalty-members).
reward_id trades points for one of the program's rewards; cents spends cashback credit or a gift card's balance; uses takes visits from a visit pack, a coupon's use or an event check-in.
Parameter
Description
card_id
path · string · required
A customer's card (from .../members or GET /v1/loyalty-members).
field stamps, points, credit_cents, uses_left, visits or spend_cents set to value (a correction, or a card moved from another app); kept on the history with note.
Parameter
Description
card_id
path · string · required
A customer's card (from .../members or GET /v1/loyalty-members).
A stamp, points, a purchase, a use or a refill from the last 24 hours (event_id from the card's history): its balances come back and the rewards it gave are voided (refused when one was already used).
Parameter
Description
card_id
path · string · required
A customer's card (from .../members or GET /v1/loyalty-members).