Send WhatsApp messages from your own website, app or CRM, work the shared inbox, and receive customer messages on your server. Every request is JSON over HTTPS, and everything follows the same rules as the Flowsensy panel: plan limits, wallet charges, opt-outs and WhatsApp’s 24-hour window.
1
Create a key
Start a free trial, then open Developers → Create key in your panel. Your plan must include API access.
2
Send a template
The first message to a customer is always an approved template.
3
Receive events
Add a webhook to get replies and delivery updates.
Base URL:
https://app.flowsensy.com/api/v1
Every endpoint below has a Try it button: add your key at the top and send a real request from this page. Press to search for any endpoint, field, error code or event.
Prefer a collection? Download the OpenAPI file and import it into Postman or Insomnia. Using n8n? See n8n: no code needed.
Send your key in the Authorization header as a bearer token (or in X-API-Key). Keys start with fs_live_ and belong to one account. Keep them on your server, never in a website or mobile app, and revoke a key in Developers if it leaks.
Errors have a stable code you can program against, a human message you can show or log, and a requestId to quote to support. Validation errors list each bad field in details.fields.
The app this call belongs to (WhatsApp Store, Bookings, Subscriptions, Website live chat, Instagram, Sales CRM, Helpdesk, Forms…) is switched off on the Apps page. Activate it and retry. See GET /v1/apps.
402
PLAN_LIMIT_REACHED
A plan limit (for example contacts) is used up.
403
ACCOUNT_SUSPENDED
The account is suspended; nothing can be sent.
404
NOT_FOUND
Template, message, contact or chat not found.
409
WINDOW_CLOSED
More than 24 hours since the customer wrote: send a template.
409
CONTACT_OPTED_OUT
The contact sent STOP; marketing templates are refused.
409
CONTACT_BLOCKED
You blocked this contact; nothing can be sent until they are unblocked.
409
FORM_CLOSED
The form isn’t taking responses (closed, past its date or full).
409
ALREADY_RESPONDED
The form allows one response per phone or email, and this person already sent one.
409
NO_CHAT
There’s no chat with this number yet (starting a chatbot).
409
MEDIA_NOT_READY
The file is still being downloaded from WhatsApp: retry shortly.
409
SEND_FAILED
WhatsApp refused the message; the reason is in message.
409
SEND_UNCERTAIN
WhatsApp didn’t answer in time. Don’t resend: check the status.
409
IDEMPOTENCY_IN_PROGRESS
The same Idempotency-Key is still being processed: retry in a moment.
422
VALIDATION_FAILED
Bad input; details.fields says which.
429
RATE_LIMITED
Too many requests this minute.
Rate limits
Each key may make 600 requests a minute. Every answer carries X-RateLimit-Limit and X-RateLimit-Remaining; over the limit you get 429 RATE_LIMITED, so wait a few seconds and retry. For sending to many people at once use Campaigns in the panel: they pace themselves to WhatsApp’s limits.
Safe retries (Idempotency-Key)
Networks fail. Send a unique Idempotency-Key header (8–100 letters, numbers, - _ . :, for example your order id) with each send. Retry with the same key and body within 24 hours and you get the first answer back: the message is never sent or charged twice. A replayed answer carries Idempotent-Replayed: true.
bash
-H "Idempotency-Key: order-10023-confirmation"
If you get SEND_UNCERTAIN, WhatsApp didn’t answer in time. Don’t send again with a new key; check GET /v1/messages/{id} or wait for the message.status webhook.
The 24-hour window
WhatsApp lets businesses send free-form messages (text, media, buttons) only within 24 hours of the customer’s last message. Outside that window, or for the first message ever, send an approved template. Conversations show windowOpen and windowClosesAt so you can choose before sending; otherwise you get 409 WINDOW_CLOSED.
Charges
API messages cost exactly what the same message costs from the panel. The price is held from your wallet when you send and charged only when WhatsApp confirms; failed messages are never charged, and WhatsApp’s free messages (for example most replies inside the 24-hour window) cost nothing. priceInr on a message is the held amount, excluding GST.
Account
Your account
GET/v1/account
Your account, wallet balance and connected WhatsApp numbers. A good first call to check your key works.
Use whatsappAccounts[].id as accountId in other calls if you have more than one WhatsApp account.
Money is a plain decimal string in rupees ("1250.000000"), never formatted.
The apps in your account — WhatsApp, Instagram, Website live chat, Subscriptions, Bookings, WhatsApp Store, Sales CRM, Helpdesk, Forms and the others on the Apps page — and whether each is in your plan and switched on.
status is NOT_IN_PLAN, INACTIVE, ACTIVE or CONNECTED (WhatsApp / Instagram with a number or account connected).
Calls for a switched-off app answer 403 APP_INACTIVE, and its webhooks (for example booking.created) stop until it is activated again. Nothing is deleted.
Leads, pipelines, follow-up tasks and quotations belong to **Sales CRM** (sales_crm); tickets and the help centre to **Helpdesk** (helpdesk); forms and responses to **Forms** (forms). Their calls answer FEATURE_NOT_IN_PLAN or APP_INACTIVE while the app is out of the plan or switched off, and their webhooks (lead.*, quote.*, task.due, ticket.*, form.*) stop.
Apps are switched on and off on the Apps page in the panel; you get app.activated / app.deactivated webhooks when that happens.
Your message templates with their text, category, approval status and how many variables each needs.
Create templates in the panel; Meta reviews them. variables.body tells you how many params.body values to send.
Carousel, limited-time offer and map-pin templates say what else they need in variables.cards, variables.offerExpires and variables.location. optOutButton is the position of a "Stop promotions" button (a tap opts the contact out of marketing).
Marketing templates are refused for contacts who opted out (CONTACT_OPTED_OUT).
The price is held from your wallet now and charged when WhatsApp confirms; failed messages are never charged.
Body
tostringrequired
The customer’s number with country code, e.g. +919876543210. Without one it’s treated as Indian.
accountIduuid
Which WhatsApp account sends it. Needed only if you have more than one (see GET /v1/account).
template.namestringrequired
The template’s name, exactly as in the panel.
template.languagestring
e.g. en, hi. Needed only if the name exists in several languages.
params.bodystring[]
Values for {{1}}, {{2}}… in the body, in order.
params.headerstring
Text for a text header, or an https link for an image, video or document header.
params.headerFilenamestring
File name the customer sees for a document header.
params.buttonsobject
Variables of link buttons by button position, e.g. {"0": "track/10023"}.
params.codestring
One-time password or offer code for authentication and coupon templates (up to 15 characters).
params.locationobject
Map-pin header templates (variables.location is true): {"latitude": 19.0596, "longitude": 72.8295, "name": "Kumar Stores", "address": "Hill Road, Bandra"}. Name and address are optional.
params.offerExpiresAtstring
Limited-time offers with a countdown (variables.offerExpires is true): when the offer ends, as an ISO time in the future, e.g. 2026-11-20T18:30:00Z.
params.cardsobject[]
Carousel templates (variables.cards lists each card): one entry per card, in order — {"header": "https://…/photo.jpg", "body": ["₹899"], "buttons": {"0": "p/123"}}. header is a public https link to the card’s photo or video.
Change a chat’s status. A customer writing again reopens it by itself.
Path parameters
iduuidrequired
The conversation id.
Body
statusstringrequired
The new status. NEW: the customer wrote and nobody has picked it up; NEEDS_HUMAN: an AI assistant or chatbot handed it over; OPEN: a person is working on it; PENDING: waiting; RESOLVED: done.
Voice calls visitors made with your AI assistant (“Talk to us”), newest first — with transcript, summary and outcome (COMPLETED = handled by the AI, HANDED_OVER, NO_AGENT, LIMIT, FAILED).
Add a customer to a plan, or on custom terms of their own (no plan). Without a trial, the first invoice is made now (or recorded as paid). Renewal invoices, reminders and pay links follow automatically — nothing is debited.
The active-subscription limit of your plan applies (LIMIT_REACHED).
Body
planIduuid
From GET /v1/recurring/plans. Give this or custom.
customobject
Custom terms for this customer only, instead of a plan: name, price, period (WEEKLY, MONTHLY, QUARTERLY, YEARLY or DAYS + periodDays), and optional description, gstPercent (0, 5, 12, 18, 28), setupFee, trialDays, usageLimit, usageLabel. The subscription shows plan.custom: true.
contactIduuid
An existing contact. Or give phone (found or added on your WhatsApp number).
phonestring
The customer’s WhatsApp number, with country code (+919876543210). Numbers without one are read as Indian.
namestring
Their name (new contacts).
emailstring
Used when there’s no WhatsApp template for a notice.
startDatedate
YYYY-MM-DD, default today.
trialDaysinteger
Overrides the plan’s trial (0 = none).
pricestring
Price for this customer in rupees, e.g. 1299.
firstPeriodPaidboolean
Record the first period as already paid. Default false.
Move it on (confirmed, packed, shipped…), add the tracking number and link, or mark it paid. The customer gets the WhatsApp update set for that status unless notify is false. Cancelled and returned orders put stock back.
Free start times on one date, worked out from working hours, days off, the service’s length + buffers and the seats per slot. Times are in your booking time zone.
Your lead pipelines and their stages (in order). Stage kind is OPEN, WON or LOST.
Lead capture, stage automations and follow-up sequences are now flows (Flows → “New chat started”, “Lead stage changed”, and flows started from the API). Their old app settings answer 409 MOVED_TO_FLOWS.
Add a lead from your website, app or another system. Without a stage it starts in the default pipeline’s first stage; without an owner it stays unassigned (a flow can assign it).
Needs Lead management in your plan; the monthly lead limit applies.
An open lead with the same phone or email answers 409 DUPLICATE_LEAD (with the existing lead) unless allowDuplicate: true.
Body
namestring
The person’s name.
phonestring
Phone; 10 digits are taken as Indian (+91).
emailstring
Email.
titlestring
Shown on the board. Default: name and interest.
intereststring
What they want.
valuenumber
Deal value in rupees.
companystring
Company.
citystring
City.
pipelineIduuid
Pipeline (from GET /v1/pipelines).
stageIduuid
Stage to start in.
ownerIduuid
Owner (from GET /v1/team).
prioritystring
Default NORMAL.
LOWNORMALHIGHURGENT
tagsstring[]
Up to 20.
fieldsobject
Your own lead fields, by key.
sourcestring
Shown as the source. Default API.
APIWHATSAPPINSTAGRAMWEBFORMIMPORTMANUAL
utmobject
utm_source, utm_campaign… kept with the lead.
notestring
A first note on the timeline.
allowDuplicateboolean
Create even when an open lead for this person exists.
A follow-up with a due time; its owner gets a reminder (and task.due fires) when it is due. GET the same path lists them; PATCH /v1/lead-tasks/{id} with { "done": true } completes one.
A form and its questions. Each question’s id is the key of its answer in responses, webhooks and POST /v1/forms/{id}/responses.
type is one of short_text, long_text, email, phone, number, url, dropdown, radio, checkboxes, yes_no, date, time, datetime, rating, file, address, consent, hidden — plus heading and page_break, which take no answer.
A form’s responses, newest first, with search and filters.
answers is keyed by question id: text, a list (checkboxes), { fileId, name, size, type } (files — download with the files endpoint) or { line1, city, … } (addresses).
source holds where it came from: page, referrer, utm_*, device, browser, via.
Path parameters
iduuidrequired
The form id.
Query parameters
qstring
Name, phone, email, any answer, or #12 for a number.
statusstring
Only this status.
NEWSEENDONE
fromdatetime
Received at or after (ISO 8601 with offset).
todatetime
Received before.
fieldstring
With value: only responses whose answer to this question contains it.
Adds a response as if someone filled in the form: the same checks (required, formats, choices, conditions) and the same after-submit actions (contact, lead, WhatsApp, team alert, flow, webhooks).
Sends a real message · charged
Answers are keyed by question id. Phone numbers need the country code. A closed form answers FORM_CLOSED; “one response per person” answers ALREADY_RESPONDED.
File questions can’t be answered through the API.
The form’s WhatsApp template (if any) is charged like any template message.
Path parameters
iduuidrequired
The form id.
Body
answersobjectrequired
Question id → answer: text, a list for checkboxes, yes/no, { line1, city, … } for an address.
sourceobject
Optional: where it came from, e.g. { "utm_source": "crm" }.
Changes a response’s status or team note. A status change sends form.response.updated and can start flows with the trigger “Form response status changed”.
200 · A CSV file: number, received, status, then one column per question.
Webinars
List webinars
GET/v1/webinars
Your webinars with their registration page, the open link (joinUrl, join without registering; null when off), next session and counts (Webinars app). durationSeconds is the webinar length after any trim; trim is where it starts and ends inside the video (endSeconds null = the video’s end).
Gives a person a seat in the next session (or the session you name). They become a contact on your WhatsApp number, get the confirmation reminder, and start any “Registered for a webinar” flows.
Registering the same number for the same session again returns the same seat (created: false).
roomUrl is their personal room link — send it to them. replayUrl opens after the session when the webinar’s replay is on.
Path parameters
iduuidrequired
The webinar (must be running).
Body
namestringrequired
Up to 120 characters.
phonestringrequired
WhatsApp number with the country code, e.g. +919876543210.
emailstring
Optional.
sessionIdstring
A session from List upcoming sessions, or a just-in-time slot (jit-<epoch ms>, as the registration page offers). Default: the next one.
Stops everything to and from this contact: sends of any kind are refused with CONTACT_BLOCKED, campaigns leave them out, chatbots stop, and their new messages stay out of the inbox (no message.received webhook).
WhatsApp itself only lets a business block someone within 24 hours of their last message. Then onWhatsapp is true and they can’t message or call your number. Otherwise they are blocked in the panel at once (onWhatsapp: false, with a note) and on WhatsApp automatically the next time they write.
Calling it again for a blocked contact changes nothing.
Path parameters
phonestringrequired
e.g. 919876543210.
Query parameters
accountIduuid
Which WhatsApp account sends it. Needed only if you have more than one (see GET /v1/account).
Your published flows (chatbots and automations). GET /v1/bots still works and returns the same.
trigger is the business event that starts it (e.g. lead.won, order.shipped, subscription.payment_failed), schedule for a timetable, date for before / after a date, api for flows started only from the API or another flow, or null for chat flows (keywords, first message…).
channel is ANY for flows that don’t start from a chat: they message each customer on the channel they use (WhatsApp first).
A flow’s trigger, whether it’s live and its published version.
trigger.type is an event (with filter, e.g. { "status": "SHIPPED" }), schedule (repeat, days, monthDay, time, audience, perMinute), date (source, field, amount, unit, dir, time), api or chat.
pausedReason is set when the flow was switched off automatically — e.g. WhatsApp rejected or paused a template it sends. Publishing again or switching it on clears it.
Any flow already running in their chat stops. With phone, a new number becomes a contact with a WhatsApp chat (nothing is sent until the flow sends). POST /v1/bots/{id}/start still works.
Sends a real message · charged
A new number hasn’t written to you, so the flow should begin with a Template step (or give its first message a fallback template).
Numbers without + use the country of the WhatsApp number it goes from. name, email and tags fill gaps on the contact; they never overwrite.
If the customer last wrote more than 24 hours ago, only a flow that begins with a Template step can start (WINDOW_CLOSED otherwise).
values can be used in the flow’s messages as {{order_no}}.
Flows whose trigger is “Only from the API or another flow” are made for this.
WhatsApp follow-up sequences are now flows like this (“… (moved from Follow-up sequences)”): start one for a lead’s customer here, with their phone or contactId.
A step with a fallback template sends that template instead when the 24-hour window is closed; with “If this fails” on, a message that can’t be sent follows that arrow instead of failing the run.
Path parameters
iduuidrequired
The flow id (from GET /v1/flows).
Body
contactIduuid
The contact (their chat on the flow’s channel). Give this, phone or conversationId.
phonestring
Or a phone number — new or known. New numbers get a contact and a WhatsApp chat.
conversationIduuid
Or the chat.
accountIduuid
Which WhatsApp account sends it. Needed only if you have more than one (see GET /v1/account).
namestring
With phone: the contact’s name (if it has none yet).
emailstring
With phone: the contact’s email (if it has none yet).
tagsstring[]
With phone: up to 10 tags to add.
valuesobject
Up to 30 values for the flow; names use lowercase letters, numbers and _.
Each flow has its own secret address (the flow’s trigger panel → Incoming webhook). No API key: the secret is in the address. Made for n8n, Pabbly and website forms.
Sends a real message · charged
phone is required (mobile or whatsapp work too). A new number becomes a contact with a WhatsApp chat.
Every other key becomes a value in the flow: {"order_id": "A-1042"} → {{order_id}}. Nested objects are flattened one level ({"customer": {"city": "Pune"}} → {{customer_city}}).
The flow must be published and on (FLOW_OFF otherwise). Up to 120 calls a minute. Each call shows in the flow’s Runs.
“Make a new address” in the builder stops the old one at once.
Path parameters
tokenstring
The secret part of the flow’s webhook address.
Body
phonestring
The number to run the flow for (with country code, or national for your WhatsApp number’s country).
namestring
Optional: the contact’s name.
emailstring
Optional: the contact’s email.
tagsstring[] or string
Optional: tags to add (an array, or comma-separated).
A short link (and QR code) that opens a WhatsApp chat with your number, with an optional ready-typed message.
With trackRef (default on), the message ends with a short code like “(Ref: K7Q2X)” so chats are matched to the link exactly.
kind: CHAT, AGENT (give assignUserId; chats are assigned to that person) or FEEDBACK (the customer is asked for 1–5 stars and a comment).
When someone writes in: tags are added to the contact, then botId starts that chatbot or welcomeReply is sent.
Custom destinations: send target: "CUSTOM" and destinations instead of accountId to point the link at any WhatsApp number, a phone call, SMS, Telegram, Instagram, Messenger, email or web address. Nothing comes into your inbox — only clicks are counted — so kind must be CHAT and tags, botId, welcomeReply and assignUserId can’t be used.
Each destination: type (WHATSAPP, CALL, SMS, TELEGRAM, INSTAGRAM, MESSENGER, EMAIL or URL), value (the number with its country code, username, email or https address), and optionally label, message (WhatsApp, SMS, email body), subject (email), start (Telegram bots), igMode (DM or PROFILE) and hours ({ days: [1,2,3,4,5], from: "09:00", to: "18:00" }, for the HOURS rotation).
With several destinations, rotation picks one per open: SINGLE (the first), ROUND_ROBIN (in turn), RANDOM, or HOURS (the first whose hours cover now, in your business time zone; one without hours is the fallback).
Body
targetstring
ACCOUNT (default) or CUSTOM.
ACCOUNTCUSTOM
accountIduuid
Which WhatsApp account sends it. Needed only if you have more than one (see GET /v1/account).
destinationsobject[]
CUSTOM: up to 10 destinations (see the notes).
rotationstring
CUSTOM with several destinations: SINGLE, ROUND_ROBIN, RANDOM or HOURS.
SINGLEROUND_ROBINRANDOMHOURS
namestringrequired
Only your team sees it.
slugstring
The address after /w/ (3–40 lowercase letters, numbers, -). Made from the name when left out.
kindstring
CHAT, AGENT or FEEDBACK.
CHATAGENTFEEDBACK
messagestring
Ready-typed message (up to 500 characters).
trackRefboolean
Add the ref code to the message (default true).
tagsstring[]
Added to the contact when they write in.
botIduuid
Chatbot to start when they write in.
welcomeReplystring
Text to send when they write in (if no chatbot).
assignUserIduuid
Team member the chat is assigned to (required for AGENT).
Send the whole link, as when creating it. The short address and printed QR codes keep working — handy for pointing a custom-destination link at a new number.
A link keeps its target: a link to a connected account stays on that account, and a custom-destination link stays custom.
Keep each destination’s id to keep its click count.
Sends one event to a webhook right now, marked "test": true with an id starting evt_test_, and answers with what your server replied and exactly what we sent (headers, signature and body). Never retried.
Leave out data and it is filled for you with exactly the fields of a real event: from your last real event of that type, else your latest matching data, else example values.
Or send your own data (the event’s data object). Leave out event for a simple ping.
The webhook must be subscribed to the event. Works for webhooks added in the panel or by API.
Path parameters
iduuidrequired
The webhook.
Body
eventstring
The event to send, e.g. message.received. Leave out for a ping.
dataobject
Optional: the event’s data, with the same fields as a real one.
Add your server’s https address in Developers → Webhooks (or by API) and choose events. We POST JSON like the examples below and expect any 2xx within 10 seconds.
Failed deliveries are retried with growing gaps for about 24 hours; you can resend from the panel. After 3 days of failures the webhook is turned off and you’re emailed.
Events can arrive more than once or out of order: use id to skip duplicates and timestamps to order them.
Answer quickly and do slow work afterwards (a queue), so deliveries don’t time out.
To try your code, use Send test on a webhook in Developers (or by API): it sends any event with every real field, filled from your own data, marked "test": true.
message.received
A customer sent a message.
Other types: image, video, audio (voice notes have media.voice: true), document, sticker → a media object with url, mimeType, caption; button and interactive → text / reply; location; reaction. newConversation: true marks a customer’s very first message. channel is whatsapp or instagram: Instagram messages have from: null and instagram: { id, username } instead, payload for a tapped button or quick reply, and types such as story_mention, share and ig_reel.
by is a person, { "api": true } for integrations, or { "customer": true }. A person taking an unassigned chat (“joined”) or a teammate’s chat (“took over”) has by.userId equal to assignedUserId.
by is { "customer": true } when a customer’s message reopened the chat, and { "auto": true, "reason": "inactive", "minutes": 1440 } when the chat was resolved automatically after that many minutes without messages (Settings → Automation → Auto-resolve inactive chats).
Your team, a chatbot or the AI assistant replied in a website or app chat.
Use it to send your app user a push notification. externalId is your own user id (when the app opened the chat for a signed-in user). online is false when the user doesn’t have the chat open.
Subscriptions: a customer subscription or membership was added (panel, import or API).
Also customer_subscription.renewed (a paid renewal started the next period), .paused, .cancelled, .expired (renewal off or unpaid past the grace days) and .payment_failed (an invoice not paid by its due date) — same shape.
WhatsApp Store: a customer placed an order on your store website.
Also store_order.status_changed (confirmed, packed, shipped — with trackingNumber / trackingUrl — delivered, returned), store_order.paid and store_order.cancelled — same shape.
Forms: someone filled in one of your forms (the hosted link, a website embed or `POST /v1/forms/{id}/responses`).
answers is keyed by question id; labels gives each question’s text. Attached files carry a url for the API files endpoint. Also form.response.updated (with changes, e.g. { "status": { "from": "NEW", "to": "DONE" } }, or { "answers": true } when the person edits it) and form.response.deleted — same shape.
A visitor started a website or app chat (a brand-new chat, or a new one after the last was closed).
answers holds the visitor’s replies to your own pre-chat questions (set in the widget’s Pre-chat form), keyed by each question’s id: text, number, true for a ticked checkbox, or a date as YYYY-MM-DD.
A call ended — with its length, and the recording link when it was recorded.
status: COMPLETED, MISSED, DECLINED, CANCELLED or FAILED. A recording may still be saving (recordingStatus: PROCESSING); fetch the call again a minute later.
A call with your AI assistant connected — started by the visitor (“Talk to us”), by a team member (“Call with AI”), or handed to the AI by a team member. `origin` is visitor, agent_started or agent_transfer; `agentUserId` / `agentName` / `agentNote` say who started it and what they asked the AI to do.
outcome is COMPLETED, HANDED_OVER, TIMED_OUT, TAKEN_OVER (a person replied), STOPPED or FAILED. startedBy is trigger (a chat message), event (a business event, e.g. a lead won, or another flow), manual (inbox / API) or test.
Flows: a run stopped on an error (a message WhatsApp refused, a step that failed…). `reason` says why in plain words.
flow.run.failed
{
"type": "flow.run.failed",
"data": {
"sessionId": "…",
"bot": {
"id": "…",
"name": "Welcome new leads"
},
"conversationId": "…",
"startedBy": "event",
"trigger": "new lead",
"outcome": "FAILED",
"reason": "The customer last wrote more than 24 hours ago",
"values": {},
"startedAt": "…",
"endedAt": "…"
}
}
app.activated
Apps: an app was switched on in the panel (its pages, public pages, automations and webhooks start again).
Also app.deactivated when an app is switched off — same shape with active: false. While an app is off, its own events (for example booking.* for Bookings) aren’t sent.
Every event has X-Webhook-Signature: t=<unix time>,v1=<hex>. Compute HMAC-SHA256 of <t>.<raw request body> with your webhook’s secret (whsec_…) and compare. Reject requests older than 5 minutes. Use the raw body, before any JSON parsing.
Test vector: secret whsec_test, t 1700000000, body {"a":1} → 38877139021993b830af32feea6e18a8da83eb2f6e49ee50bd9e4cf4ca4d3789
Chatbot API requests (the bot calls you)
A chatbot’s API request step can call any API: GET, POST, PUT, PATCH or DELETE, with query parameters, headers, bearer or basic auth, and a JSON, form or text body. Values like {{order_no}} can be used anywhere. Values picked from the answer by path (for example data.order.status) become {{status}} for later steps; {{api_status}} holds the HTTP status. Every request is signed with the bot’s secret (same X-Webhook-Signature format as events). It must answer 2xx within 10 seconds (up to 256 KB), otherwise the bot follows Failed.
reply is sent to the customer, other values can be used in later steps, and fields are saved on the contact.
Live chat in your app
Every live chat widget (Website widget → Live chat) also works inside Android and iOS apps. Chats land in the same Inbox, with your chatbots, auto-replies and AI assistant.
1. The easy way — the chat page in a web view. Open https://app.flowsensy.com/chat/WIDGET_KEY in a WebView (Android), WKWebView (iOS) or a React Native / Flutter web view. For a signed-in user add ?uid=USER_ID&name=…&email=…&sig=SIGNATURE so their chat follows them on every device. Your server makes sig = HMAC-SHA256 of the user id with the widget’s identity secret (widget page → Install → Chat page for apps). Never put the secret in the app.
2. Your own chat screen — the Chat API. No API key: the widget key identifies the chat and each user gets a private token. Send the token in X-Visitor-Token.
curl -X POST https://app.flowsensy.com/api/public/livechat/WIDGET_KEY/messages \
-H 'X-Visitor-Token: TOKEN' -H 'Content-Type: application/json' \
-d '{"text":"Is my order shipped?"}'
GET /api/public/livechat/WIDGET_KEY/session — the user and their last 50 messages; GET …/messages?before=ID for older ones.
GET …/stream?token=TOKEN — live updates (Server-Sent Events): message and typing.
POST …/files (multipart, field file, up to 10 MB), POST …/typing, POST …/seen, PUT …/details (name, email, phone), POST …/transcript.
Conversations: GET …/session also returns sessions (the user’s chats, newest first) and current. Only one chat is open at a time; GET …/sessions/ID/messages for a past one, POST …/end to end it, POST …/sessions/ID/rating with {"rating":5,"comment":"…"} once it’s closed. Live events also include agent (who is answering), read and closed.
Button taps from chatbots: send {"text":"Track order","payload":"BUTTON_ID","replyTo":"MESSAGE_ID"}.
Push notifications: subscribe to the chat.reply webhook; it carries your externalId and whether the user has the chat open.
Voice messages (when the plan includes them): POST …/voice (multipart, field file: a WebM, Ogg or MP4 recording, up to 2 minutes). They come back as media.kind = "audio" (AAC in MP4) with media.seconds.
Microphone in a web view. Voice messages and calls need the microphone. Android: add RECORD_AUDIO and MODIFY_AUDIO_SETTINGS to the manifest, ask for the permission at run time, and grant it in WebChromeClient.onPermissionRequest. iOS: add NSMicrophoneUsageDescription to Info.plist and set allowsInlineMediaPlayback = true on the WKWebView configuration. React Native WebView: mediaCapturePermissionGrantType="grant". Flutter: grant the request in onPermissionRequest.
n8n
Our community node for n8n sends messages, works the inbox and starts workflows on events, with no code. It works with any panel address, so it carries Flowsensy’s branding.
In n8n open Settings → Community nodes → Install and enter n8n-nodes-wa-crm.
Add the WhatsApp CRM node. For the credential, enter your panel address (https://app.flowsensy.com) and an API key from Developers.
For events use the WhatsApp CRM Trigger node and choose them. Turning the workflow on subscribes it; turning it off removes it.
n8n must be reachable from the internet over https (n8n Cloud is; a self-hosted n8n needs a public address) so we can deliver events to it.