Start an automation from your app
Put a person into a Flowleb flow the moment something happens in your system.
Build the conversation once in the Flowleb flow builder (welcome message, questions, follow-ups, delays). Then let your website or app start it for each new person with one API call.
Before you start
- A flow built and published in Flowleb (see Flows).
Step 1 · Find the flow's id
/api/v1/flows
Lists your flows with their status.
curl https://flowleb.com/api/v1/flows -H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{ "id": 18, "name": "New lead follow-up", "trigger": "keyword",
"status": "live", "subscribers_count": 240, … }
],
"meta": { "count": 1 }
}
Only flows with status live can take new people. draft and paused flows return flow_inactive.
Step 2 · Start it for a person
/api/v1/flows/{id}/enroll
Send phone or contact_id.
curl -X POST https://flowleb.com/api/v1/flows/18/enroll \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "phone": "919876543210" }'
{
"data": {
"flow_id": 18,
"contact_id": 9120,
"subscriber_id": 30411,
"status": "active",
"enrolled_at": "2026-11-18T10:40:12+05:30"
}
}
Full example: website form
// Your website's form handler (Express). Runs on YOUR server, never in the browser.
app.post('/lead', async (req, res) => {
const { name, phone } = req.body;
const api = (path, body) => fetch(`https://flowleb.com/api/v1${path}`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.FLOWLEB_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify(body),
});
// 1. make sure the person is a contact
await api('/contacts', { name, phone });
// 2. start the follow-up flow for them
await api('/flows/18/enroll', { phone });
res.redirect('/thank-you');
});
See who is in the flow
/api/v1/flows/{id}/subscribers
Each person in the flow and where they are, with totals in meta.counts.