flow api

API reference

Every request has the same shape. Replace {method} with one of the names below.

https://flowapi.pro/waInstance{idInstance}/{method}/{apiTokenInstance}
  • chatId is 972501234567@c.us for a person and …@g.us for a group.
  • Methods marked GET take no body; everything else is POST with a JSON body unless the row says multipart.
  • Responses are JSON. Errors return {"error":true,"message":"…"} with status 400, 401 or 404.
  • Existing Green API SDKs work unchanged: set the host / apiUrl to https://flowapi.pro.

Account

GETgetSettings
Response
{"wid":"972…@c.us","webhookUrl":"","incomingWebhook":"yes",…}
POSTsetSettings
Body
{"webhookUrl":"https://…","webhookUrlToken":"secret","incomingWebhook":"yes"}
Response
{"saveSettings":true}
GETgetStateInstance
Response
{"stateInstance":"authorized"}  // notAuthorized · starting · authorized · blocked
GETgetStatusInstance
Response
{"statusInstance":"online"}
GETreboot
Response
{"isReboot":true}
GETlogout
Response
{"isLogout":true}
GETqr
Response
{"type":"qrCode","message":"<base64 png>"}  // or {"type":"alreadyLogged"}
POSTgetAuthorizationCode
Body
{"phoneNumber":972501234567}
Response
{"status":true,"code":"XXXX-XXXX"}
GETgetWaSettings
Response
{"avatar":"","phone":"972…","stateInstance":"authorized","deviceId":"…"}
POSTsetProfilePicture
Body
multipart: file
Response
{"setProfilePicture":true}

Sending

POSTsendMessage
Body
{"chatId":"972501234567@c.us","message":"Hello","quotedMessageId":"optional"}
Response
{"idMessage":"…"}
POSTsendFileByUrl
Body
{"chatId":"…@c.us","urlFile":"https://…/a.pdf","fileName":"a.pdf","caption":""}
Response
{"idMessage":"…"}
POSTsendFileByUpload
Body
multipart: chatId, file, caption, fileName
Response
{"idMessage":"…"}
POSTuploadFile
Body
raw binary body; header X-Filename
Response
{"urlFile":"https://…"}
POSTsendLocation
Body
{"chatId":"…","nameLocation":"Office","latitude":32.08,"longitude":34.78}
Response
{"idMessage":"…"}
POSTsendContact
Body
{"chatId":"…","contact":{"phoneContact":972…,"firstName":"Dana","lastName":"Levi"}}
Response
{"idMessage":"…"}
POSTsendPoll
Body
{"chatId":"…","message":"Pick","options":[{"optionName":"A"},{"optionName":"B"}],"multipleAnswers":false}
Response
{"idMessage":"…"}
POSTforwardMessages
Body
{"chatId":"…","chatIdFrom":"…","messages":["id1","id2"]}
Response
{"messages":["…"]}
POSTsendListMessage
Body
{"chatId":"…","message":"Pick a time","buttonText":"Choose","sections":[{"title":"Tomorrow","rows":[{"rowId":"am","title":"Morning"}]}]}
Response
{"idMessage":"…"}  (needs Interactive menus)
POSTsendInteractiveButtons
Body
{"chatId":"…","header":"","body":"Confirm?","footer":"","buttons":[{"buttonId":"1","type":"reply","buttonText":"Yes"}]}
Response
{"idMessage":"…"}  (shown as a menu; needs Interactive menus)
POSTsendTyping
Body
{"chatId":"…","typingType":"typing"}
Response
{"sendTyping":true}

Receiving

GETreceiveNotification?receiveTimeout=20
Response
{"receiptId":12,"body":{"typeWebhook":"incomingMessageReceived",…}}  // null when empty
DELETEdeleteNotification/{receiptId}
Response
{"result":true}
POSTdownloadFile
Body
{"chatId":"…","idMessage":"…"}
Response
{"downloadUrl":"https://…"}

Journals

POSTgetChatHistory
Body
{"chatId":"…@c.us","count":100}
Response
[{"type":"incoming","idMessage":"…","timestamp":…,"typeMessage":"textMessage","textMessage":"…"}]
POSTgetMessage
Body
{"chatId":"…","idMessage":"…"}
Response
{…message…}
GETlastIncomingMessages?minutes=1440
Response
[…]
GETlastOutgoingMessages?minutes=1440
Response
[…]

Groups

POSTcreateGroup
Body
{"groupName":"Team","chatIds":["972…@c.us"]}
Response
{"created":true,"chatId":"…@g.us","groupInviteLink":"…"}
POSTupdateGroupName
Body
{"groupId":"…@g.us","groupName":"New"}
Response
{"updateGroupName":true}
POSTgetGroupData
Body
{"groupId":"…@g.us"}
Response
{"groupId":"…","subject":"…","participants":[{"id":"…","isAdmin":false}]}
POSTaddGroupParticipant
Body
{"groupId":"…@g.us","participantChatId":"…@c.us"}
Response
{"addParticipant":true}
POSTremoveGroupParticipant
Body
{"groupId":"…","participantChatId":"…"}
Response
{"removeParticipant":true}
POSTsetGroupAdmin
Body
{"groupId":"…","participantChatId":"…"}
Response
{"setGroupAdmin":true}
POSTremoveAdmin
Body
{"groupId":"…","participantChatId":"…"}
Response
{"removeAdmin":true}
POSTleaveGroup
Body
{"groupId":"…@g.us"}
Response
{"leaveGroup":true}
POSTsetGroupPicture
Body
multipart: groupId, file
Response
{"setGroupPicture":true}

Service

POSTcheckWhatsapp
Body
{"phoneNumber":972501234567}
Response
{"existsWhatsapp":true}
POSTgetAvatar
Body
{"chatId":"…@c.us"}
Response
{"urlAvatar":"https://…","available":true}
GETgetContacts
Response
[{"id":"…@c.us","name":"…","type":"user"}]
POSTgetContactInfo
Body
{"chatId":"…@c.us"}
Response
{"chatId":"…","name":"…","avatar":"…","isBusiness":false}
POSTreadChat
Body
{"chatId":"…","idMessage":"optional"}
Response
{"setRead":true}
POSTdeleteMessage
Body
{"chatId":"…","idMessage":"…"}
Response
{"deleteMessage":true}
POSTeditMessage
Body
{"chatId":"…","idMessage":"…","message":"fixed"}
Response
{"idMessage":"…"}
POSTarchiveChat
Body
{"chatId":"…"}
Response
{"archiveChat":true}
POSTunarchiveChat
Body
{"chatId":"…"}
Response
{"unarchiveChat":true}
GETshowMessagesQueue
Response
[]
GETclearMessagesQueue
Response
{"isCleared":true}

Webhooks

Set webhookUrl (and optionally webhookUrlToken, sent as the Authorization header). Each notification is one POST with a JSON body. Answer with any 2xx. Failed deliveries are retried three times and then parked in the queue for receiveNotification.

incomingMessageReceived

A message arrived. messageData.typeMessage is textMessage, imageMessage, documentMessage, locationMessage, contactMessage, pollMessage, reactionMessage, editedMessage or deletedMessage.

outgoingMessageReceived

A message was sent from the phone.

outgoingAPIMessageReceived

A message was sent through the API.

outgoingMessageStatus

Delivery status of an outgoing message: sent, delivered, read, played, failed.

stateInstanceChanged

The instance state changed (authorized, notAuthorized, starting).

incomingCall

An incoming voice/video call.

{
  "typeWebhook": "incomingMessageReceived",
  "instanceData": { "idInstance": 1101000001, "wid": "972…@c.us", "typeInstance": "whatsapp" },
  "timestamp": 1791819789,
  "idMessage": "…",
  "senderData": { "chatId": "972501234567@c.us", "chatName": "Dana", "sender": "972501234567@c.us", "senderName": "Dana" },
  "messageData": { "typeMessage": "textMessage", "textMessageData": { "textMessage": "Hi" } }
}

Partner API

Manage instances for your own customers with the partner token from the console.

POST https://flowapi.pro/partner/createInstance/{partnerToken}   {"name":"Customer A"}
POST https://flowapi.pro/partner/deleteInstance/{partnerToken}   {"idInstance":1101000007}
GET  https://flowapi.pro/partner/getInstances/{partnerToken}

Errors

401Wrong idInstance or apiTokenInstance.
404Unknown method, or the chat / message does not exist.
400Missing fields, instance not linked, or the WhatsApp engine refused the action — message explains which.

All methods