API Reference
The WhatsFlow AI API allows you to programmatically manage your WhatsApp conversations, leads, and automation workflows. Integrate WhatsFlow directly into your own applications, CRM, or custom tools.
WhatsApp Setup
Connect your official Meta WhatsApp Business Account to WhatsFlow AI using simple technical steps to unlock automated conversation pipelines.
Gather Meta Credentials
Locate your credentials inside the Meta Developer Dashboard under "WhatsApp > API Setup".
- Phone Number ID
- WhatsApp Business Account ID
- System User Access Token
Submit API Connection
Send an authorized request to bind your Meta credentials securely to WhatsFlow.
POST /api/whatsapp/connect
{
"phone_number_id": "1059...",
"business_account_id": "8842...",
"access_token": "EAAGZ..."
}Register Callback Webhook
Enter the global WhatsFlow listener into Meta webhook config so the AI sees incoming texts:
Authentication
All API requests must include your API Key in the Authorization header. You can find your API key in the Dashboard under Settings.
Authorization: Bearer YOUR_API_KEYSend Message
Trigger an outgoing WhatsApp message to a specific phone number. You can send plain text, template messages, or even media files.
/v1/messages/sendExample Request (cURL)
curl -X POST https://api.whatsflow.ai/v1/messages/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "15551234567",
"text": "Hello from API!"
}'Example Response
{
"id": "msg_59283",
"status": "sent",
"timestamp": "2025-05-18T12:00:00Z"
}Lead Management
Retrieve and manage lead information programmatically. Sync WhatsFlow leads with your internal CRM in real-time.
/v1/leads/{lead_id}{
"id": "lead_9283",
"name": "Alex Johnson",
"phone": "+1 555-0192",
"status": "qualified",
"intent_score": 0.94
}Webhooks
Receive real-time notifications about incoming messages, status updates, and lead activities. Configure your webhook URL in the developer settings.
| Event Type | Description |
|---|---|
message.received | Triggered whenever a customer sends you a text. |
message.delivered | Sent when your outgoing message is delivered (double tick). |
lead.qualified | Triggered when the AI successfully qualifies a lead. |
appointment.booked | Sent when a customer completes a booking through AI. |
