MegaAPI
MessagingConnect AI agents to MegaAPI, a Brazilian REST API that links a WhatsApp account to your automations. Agents send text, media, and interactive messages, manage chats and groups, check numbers on WhatsApp, and receive inbound messages through a webhook trigger so WhatsApp conversations flow into and out of your workflows.
What This Integration Enables
MegaAPI is a Brazilian REST API that puts a WhatsApp account behind an HTTP interface, and the honest way to describe it is the way the vendor does. It provides access to WhatsApp outside Meta's official Cloud API, through a QR code or pairing code login of a personal or business number, in the same way WhatsApp Web does. Connected accounts remain subject to WhatsApp's terms. That is the trade the product is built around. There is no template approval workflow and no business verification queue, so a flow can send free-form text to any number that is on WhatsApp today rather than in three weeks, and in exchange you are operating a real logged-in session with all that implies. This connector targets the megaAPI Start plan and its thirty-seven documented routes.
The object everything hangs off is the instance. An instance has its own host, its own key, and its own token, and the three are only valid together, because MegaAPI assigns a different host per instance depending on which server it was created on. An instance holds one WhatsApp account, one QR code lifecycle, and one webhook URL. When it disconnects, every other operation becomes unavailable and webhook delivery stops. So a flow built on MegaAPI is really a flow built on a session, and the actions that manage that session, Get Instance Status, Get QR Code Base64, Get Pairing Code, Restart Instance, are not administrative trivia. They are the availability layer, and treating them as first-class steps is what separates an integration that runs for a year from one that dies quietly on a Tuesday.
Above that sits an unusually complete messaging surface. Text, media by URL or by base64, locations, contact cards, link previews. Interactive button, list, and template messages, where button taps come back to the instance as webhook events and template buttons act on the recipient's device by copying text, opening a URL, or dialing a number. Forwarding and quoted replies that take the key and message objects verbatim from the trigger payload, so the inbound event and the outbound reply fit together with nothing to parse. Group creation and participant management. Download Media Message decodes what MegaAPI returns and stores it in FlowRunner file storage, returning a URL rather than several megabytes of inline data.
Without FlowRunner
With FlowRunner
Use Case Scenarios
Order support that starts in the customer's thread
A Brazilian store runs customer service on WhatsApp. New Message Received fires, filtered to direct chats so group noise never enters the flow. The agent matches the sender number against the customer record in Shopify, pulls the most recent order, and answers the questions it can answer from data: where the package is, what was ordered, when it shipped. It answers using Reply To Message rather than Send Text Message, quoting what the customer wrote, because a thread with forty messages in it is unreadable otherwise. Anything touching money, a return, or a complaint goes to a human in Slack with the quoted message, the order, and the key needed to reply in the same thread.
Documents delivered where people actually read them
Invoices, boletos, and shipping labels get emailed and ignored. Here the agent sends them to the number the customer already uses, with Send Media By URL when the file has a public address and Send Media By Base64 when it was generated in the flow and never had one. Both require the file's MIME type, and captions render on images and videos only, so a document goes out with its explanation as a separate text message rather than as a caption nobody sees. When the customer replies with a photograph of a damaged item, Download Media Message pulls it into FlowRunner file storage and attaches it to the case in RD Station as a file reference instead of a several megabyte payload sitting inside a workflow run.
A structured choice instead of an open question
Asking a customer to reply with the number of the option they want produces answers like "the second one I think". Send List Message and Send Button Message replace that with a real selection UI: quick reply button taps come back as webhook events the same trigger already handles, so the agent receives a value rather than a sentence to interpret. Send List Message To Many fans a single list message out to several recipients in one request and reports the delivered and failed counts, which makes it the right shape for a delivery window confirmation across a day's shipments. The failed count is the interesting half, and it goes to a person as an automation exception rather than being averaged into a success rate.
Human-in-Loop Highlight
The gate on MegaAPI is the webhook slot, and it is a gate because an instance holds exactly one webhook URL. Enabling the New Message Received trigger registers its callback URL on the instance and replaces whatever URL was saved there. Configure Webhook replaces the trigger's URL in turn. The two cannot both be active on one instance. That means a perfectly reasonable setup step, pointing MegaAPI at a FlowRunner endpoint, can silently decapitate whatever the customer already had listening: a chatbot, an internal CRM sync, a logging service that someone configured eighteen months ago and has not thought about since. Nothing errors. The old system simply stops receiving messages, and because it never received an error either, its own monitoring shows a quiet day rather than an outage.
The connector gives the agent the evidence to make this stoppable. Get Webhook Settings reads the URL currently saved on the instance. So before an agent takes the slot, it reads what is there, and if the instance already has a URL that is not FlowRunner's, it stops and asks. Into Slack: "Instance apistart02 currently posts to https://crm.internal.example/wa-hook. Enabling the WhatsApp trigger will replace that URL, and MegaAPI supports only one per instance, so that endpoint will stop receiving messages with no error on either side. Take the slot, or route this flow through a different instance?" A person who knows what that hostname is answers immediately. Nobody discovers it later, because there is nothing to discover.
That is the digital andon cord applied to configuration rather than to content, which is where it is least expected and most useful under Orchestration as a Service. It is worth naming what this gate deliberately is not. Sending a message is not gated, because a support agent answering a customer on WhatsApp is the work, and a platform that asks permission for that is a platform nobody uses. Disconnect Instance and Restart Instance deserve the same treatment as the webhook slot for the same reason: both take a live session offline, and Disconnect Instance makes every other operation unavailable until someone scans a QR code with a physical phone. Those belong to whoever owns the phone, not to a flow.
Agent Capabilities
38 actionsInstance
7- Get Instance Status Reports the WhatsApp account bound to the instance. MegaAPI signals a disconnected instance by omitting the user object from the response rather than by returning an error, so this read is the health check a flow should run before it assumes anything will send.
- Get Instance Time Lock Returns the instance's time lock state. Session metadata, read when diagnosing why an instance is behaving unexpectedly.
- List Contacts Returns the contacts known to the connected WhatsApp account. The bridge between a phone number in your CRM and the identity WhatsApp holds for it.
- Get LID To Phone Mapping Resolves WhatsApp's internal linked identifiers back to phone numbers. Needed when a payload carries an identifier that does not match anything in your own records.
- Check Number On WhatsApp Checks whether a number is reachable on WhatsApp at all. The pre-flight before treating WhatsApp as a delivery channel for a given customer rather than assuming it.
- Get Profile Picture Returns the profile picture for a contact. Used to enrich a support case with the same face the agent sees in the app.
- Download Media Message Decodes the media MegaAPI returns and stores it in FlowRunner file storage, returning its URL rather than the inline data, because WhatsApp media is frequently several megabytes. The storage scope is selectable on the action.
Connection
6- Get QR Code Page Returns the hosted QR code page for pairing the instance. The link to hand a person who needs to connect a phone.
- Get QR Code Image Returns the pairing QR code as an image. WhatsApp refreshes the code every twenty seconds, so this is a read taken at the moment somebody is looking at a screen.
- Get QR Code Base64 Returns the same pairing QR code encoded as base64, for embedding directly in a message or an internal page.
- Get Pairing Code Returns a pairing code, the alternative to scanning, for connecting an instance by entering a code on the handset.
- Disconnect Instance Disconnects the WhatsApp session. Every other operation becomes unavailable afterward and webhook delivery stops, so this is an availability decision rather than a cleanup step.
- Restart Instance Restarts the instance. The first remediation to try when the session is misbehaving but the account is still bound.
Messaging
8- Send Text Message Sends a plain text message to a contact or group. The base send, used when there is no earlier message to attach the reply to.
- Send Media By URL Sends an image, video, audio, voice note, or document from a publicly reachable file URL, with its MIME type supplied. Captions render on images and videos only.
- Send Media By Base64 Sends the same media types from a data URI with a base64 prefix. The right form for a file generated inside the flow that was never published to a public address.
- Send Location Sends a map location. Used for pickup points, service addresses, and delivery confirmations where a pin is clearer than a street name.
- Send Link Preview Sends a link rendered with its preview card rather than as bare text, so a tracking page or a payment link arrives looking like something worth tapping.
- Send Contact Card Sends a contact card. Used to hand a customer the right person or department without asking them to copy a number out of a message.
- Forward Message Forwards an existing message, taking the key and message objects verbatim from the original webhook payload. Pairs directly with the New Message Received trigger.
- Reply To Message Sends a message quoting an existing one, again taking the key and message objects from the original payload. The action that keeps a long support thread readable.
Interactive Messages
4- Send Button Message Sends a message carrying quick reply buttons, with a text, image, video, or document header. Taps come back to the instance as webhook events, so the agent receives a value rather than a sentence to interpret.
- Send Template Message Sends a message whose buttons act on the recipient's device, copying text, opening a URL, or dialing a number. Useful for delivering a code, a payment link, or a callback number.
- Send List Message Sends a selectable list, the right shape when the customer is choosing among more options than buttons comfortably hold.
- Send List Message To Many Fans a single list message out to several recipients in one request and reports the delivered and failed counts. The failed count is the half worth routing to a person.
Chats
4- Update Chat Presence Sets the presence state shown in the chat, such as typing. Used so an agent that will take a few seconds does not read as an unanswered message.
- Mark Message As Read Marks a message as read. Keeps the shared inbox honest about what has actually been handled.
- Delete Message Deletes a message for everyone in the chat. Recipients see the deletion, and what was read before it cannot be unread.
- Delete Message For Me Removes a message from the connected account's own view only, leaving it in place for the recipient. A housekeeping action, not a recall.
Groups
7- List Groups Returns the groups the connected account belongs to, with the group identifiers every other group action needs.
- Get Group Details Returns a group's metadata and participants. The read that runs before any change to membership.
- Get Group Invite Info Resolves a group invite link into information about the group behind it, before anyone joins it.
- Create Group Creates a WhatsApp group with an initial participant list. Everyone added sees the group appear immediately.
- Add Group Participants Adds participants to an existing group. Membership changes are visible to everyone already in it, so this is a public act rather than a quiet one.
- Remove Group Participants Removes participants from a group. Also visible to the remaining members, and not something to run speculatively.
- Leave Group Removes the connected account from a group. Once out, the account loses the group's history and needs an invite to return.
Webhook
2- Get Webhook Settings Returns the webhook URL currently saved on the instance. The read that makes the single webhook slot safe to reason about, because it shows what a change is about to overwrite.
- Configure Webhook Sets the instance's webhook URL. An instance holds one URL, so this replaces whatever was there, including the trigger's own registration.
Triggers
1 triggersEvent Triggers
1- New Message Received Fires in real time when a message arrives at the connected WhatsApp account. It registers its own callback URL on the instance and clears it on removal, and it shapes the inbound payload into the chat and message identifiers, the sender display name, the message type and timestamp, the readable text, and the media references Download Media Message needs. Disappearing messages are unwrapped so their inner content reads normally. Filters narrow delivery to direct or group chats, to a single chat, to chosen message types, and can exclude messages the instance itself sent. Note that MegaAPI documents no signature header or shared secret for webhook deliveries, so the trigger cannot verify their origin, and it passes over any payload that does not carry both a message type and a key.
Frequently Asked Questions
What can FlowRunner do with MegaAPI?
FlowRunner agents can run Get Instance Status, Get Instance Time Lock, and List Contacts in MegaAPI, plus 35 more actions.
Does connecting MegaAPI to FlowRunner require OAuth?
No. MegaAPI connects to FlowRunner with an API key, no OAuth flow required.
Can MegaAPI trigger a FlowRunner workflow automatically?
Yes. MegaAPI supports 1 trigger that can start a FlowRunner workflow automatically.
Start building with MegaAPI
$100 in credits. No card required. Connect in minutes.