Skip to content
New Describe an automation in plain words, and AI builds it for you.
Developers

Send messages

Text, photos, documents, voice notes and locations, on WhatsApp and other channels.

6 min read Developers

POST /api/v1/messages

Sends one message to one person.

Fields

FieldNeeded?What it is
to Yes Who gets it. WhatsApp: phone with country code, digits only.
type No text (default), image, video, document, audio or location
text For text The message, up to 4,096 characters. For media, it becomes the caption.
media For media The file itself (multipart upload, up to 16 MB)
media_url For media Or a public link to the file; Flowleb downloads it
latitude · longitude For location The place to share
device_id No Which of your WhatsApp numbers sends it. Default: your main number.
channel No whatsapp (default), instagram, facebook or telegram
connection_id No Other channels only: which Page, account or bot sends it

Text

curl -X POST https://flowleb.com/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "919876543210",
    "type": "text",
    "text": "Hi Maya, your order #2045 has shipped!"
  }'

Photos, videos, documents and audio

There are two ways. Pick whichever is easier for you.

The file is already online (a public https link) Send media_url in JSON
The file is on your server or computer Upload it as media (multipart)
Option A · link to the file
curl -X POST https://flowleb.com/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "919876543210",
    "type": "image",
    "media_url": "https://yourshop.com/images/order-2045.jpg",
    "text": "Your parcel is packed and ready 📦"
  }'
Option B · upload
curl -X POST https://flowleb.com/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F to=919876543210 \
  -F type=document \
  -F text="Invoice for order #2045" \
  -F media=@invoice-2045.pdf

Location

cURL
curl -X POST https://flowleb.com/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "919876543210",
    "type": "location",
    "latitude": 19.0760,
    "longitude": 72.8777
  }'

Choose which number sends

If you have more than one WhatsApp number connected, list them and pass the one you want as device_id.

GET /api/v1/devices

Lists your connected WhatsApp numbers.

cURL
curl https://flowleb.com/api/v1/devices \
  -H "Authorization: Bearer YOUR_API_KEY"
Response 200 OK
{
  "data": [
    { "id": 57, "name": "Shop phone", "phone": "919800000001",
      "engine": "unofficial", "status": "connected", "active": true,
      "last_seen_at": "2026-11-18T09:58:12+05:30" },
    { "id": "cfg_20", "name": "Maya's Store", "phone": "919800000002",
      "engine": "whatsapp_cloud", "status": "connected", "active": true,
      "last_seen_at": "2026-11-02T14:11:40+05:30" }
  ],
  "meta": { "count": 2 }
}
Request body with device_id
{
  "to": "919876543210",
  "device_id": "cfg_20",
  "type": "text",
  "text": "Sent from our official number"
}
unofficial
A number linked by scanning a QR code.
whatsapp_cloud
A number on the official WhatsApp Business API (Meta). The 24-hour window and template rules apply.
twilio
A number connected through Twilio.

Instagram, Messenger and Telegram

Set channel and use that platform's id for the person in to: Instagram user id, Messenger page-scoped id (PSID), or Telegram chat id.

Reply on Instagram
curl -X POST https://flowleb.com/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "instagram",
    "to": "1784140000000000",
    "text": "Thanks for your message! Your order ships tomorrow."
  }'

Know what happened to it

The response tells you the status straight away (sent, or failed with a reason). After that, the status moves on to delivered and read.

sent
delivered
read
Check one message
GET /messages/{id}
Get told automatically
Subscribe to message_delivered, message_read and message_failed webhooks
Why it failed
failure_reason (readable text) and error_code (Meta's code) are filled in on failed messages

Still stuck? Ask the team, a person replies by email.