Migrate from WAHA to the official WhatsApp API
In short: to move a bot or an automation from WAHA to Meta's official WhatsApp Cloud API, connect the number to ZapClaw through Coexistence, send through ZapClaw's REST API instead of /api/sendText, and read ZapClaw's webhook instead of WAHA's message event. The number keeps working in the WhatsApp Business app on your phone. Below: the steps, the text and media send fields and the main webhook fields side by side, and what has no equivalent on the official API.
ZapClaw is a hosted gateway on Meta's Cloud API: no WAHA server or session to keep running and no Meta app of your own.
Business plan: US$ 29 per month, with unlimited numbers
Start for free See the field mappingWhy move to the official API
- WhatsApp's terms. WAHA's engines run WhatsApp Web in a browser or talk to WhatsApp Web over a WebSocket, and WAHA's own introduction says WhatsApp does not allow bots or unofficial clients, so the method “shouldn't be considered totally safe”. WhatsApp's Terms of Service forbid using the service through automated means in ways WhatsApp has not authorized, and name auto-messaging among the communications they do not permit. Meta's Cloud API is the API Meta offers businesses for this.
- The app stays on the phone. With Coexistence your team keeps answering in the WhatsApp Business app while your system uses the API on the same number, and the chats stay in sync.
- Nothing to host for WhatsApp. WAHA is software you install on your own server. ZapClaw runs the gateway; you keep only the system that receives your webhook.
- Signed webhooks with no setup. WAHA signs its webhooks with HMAC SHA-512 when you give the session a key. ZapClaw signs every body with HMAC-SHA256 from the start and keeps every event for replay from the dashboard.
Meta's policies still apply on the official API: Meta can restrict or disable an account that breaks them, and ZapClaw's API then answers 403 with the reason (errors).
What you need to connect
- The WhatsApp Business app on the number, version 2.24.17 or newer, in regular use.
- Two-factor authentication on the personal Facebook account that authorizes the connection.
- The number not connected to another provider. If it is, disconnect it there first.
- A computer to run the connection, with your phone at hand to confirm it in the app.
You do not need a company tax ID or a verified business to connect. The full checklist.
The move, step by step
- Map your code first. Change your send calls and your webhook handler with the tables below, or put the shim in front of your flow so it keeps its WAHA calls while you rewrite it.
- Check the number. Coexistence connects numbers that run on the WhatsApp Business app, not on regular WhatsApp. Back up your chats in the app and check the requirements above.
- Connect the number. Create your ZapClaw account and connect the number in Meta's window from the dashboard. Meta then unlinks every linked device from the account, the WAHA session included. Stop or delete the session in WAHA afterwards, so nobody scans its QR code again and two systems answer the same customer.
- Set the webhook. In the dashboard, under Webhook, paste your public HTTPS URL, pick the events and copy the signing secret. Tick Messages sent from the WhatsApp Business app if your flow listened to
message.anyfor your own messages. - Create an API key and send with it in the
X-API-Keyheader tohttps://api.zapclaw.app. Thefromfield names the number, so one key sends from every number of the account. - Create your templates. Outside the 24-hour window, and to write first, Meta accepts only an approved template. Create them in the dashboard or with
POST /api/v1/send/templates, and passlanguagewhen you send one: the API's default ispt_BR. - Test. Press Send test event on the dashboard's Webhook page, then write to your number from another phone and check that your flow receives the message and replies.
Sending: WAHA calls and their ZapClaw equivalent
WAHA's paths are relative to your WAHA server, and ZapClaw's to https://api.zapclaw.app.
| WAHA | ZapClaw | |
|---|---|---|
| Send text | POST /api/sendText |
POST /api/v1/send/text |
| Send media | /api/sendImage, /api/sendVideo, /api/sendVoice, /api/sendSticker, /api/sendFile |
POST /api/v1/send/media with type image, video, audio, sticker or document |
| Authentication | X-Api-Key header |
X-API-Key header, with a ZapClaw key |
| Your number | session, in the body |
from, in the body |
| Recipient | chatId: the number plus @c.us |
to: the number, digits only |
| Text | text |
text, up to 4,096 characters |
| Link preview | linkPreview |
previewUrl |
| Reply to a message | reply_to |
replyTo: the wamid of the message |
| Media file | file.url, or file.data in base64, with file.mimetype |
link, a public https URL, or mediaId from POST /api/v1/media |
| File name | file.filename |
filename (document) |
| Caption | caption |
caption (image, video, document) |
| Format conversion | convert, asNote |
No equivalent: send a format WhatsApp accepts |
| Mentions | mentions |
No equivalent |
Location, contact cards and reactions go through POST /api/v1/send/location, /send/contacts and /send/reaction (API reference). The shim further down does not convert those calls yet: send them straight to ZapClaw.
Receiving: the message event and its ZapClaw equivalent
WAHA posts an envelope with event, session, me and payload; the payload paths below are those of a message event. ZapClaw posts event, timestamp, data and account to one URL for all your numbers.
| WAHA | ZapClaw | |
|---|---|---|
| Event | message; message.any also includes your own |
message.received; your own messages from the app come as message.echo (opt-in) |
| Which of your numbers | session, me.id |
account.phone_number_id, account.display_phone_number |
| Sender | payload.from: the number plus @c.us |
data.from, digits only, and data.user_id, the contact's durable id |
| Sent by you | payload.fromMe |
The message.echo event, with data.to |
| Message id | payload.id |
data.message_id, a wamid |
| Contact name | Not in the documented payload; it sits in the engine's own _data |
data.contact_name |
| Time | payload.timestamp: seconds in the documentation's examples |
data.timestamp: seconds, as a string |
| Text | payload.body, which holds the caption on media |
data.text.body, or data.<type>.caption on media |
| Has media | payload.hasMedia |
data.type is image, audio, video, document or sticker |
| Media file | payload.media.url, downloaded with your X-Api-Key |
data.<type>.media_url, downloaded with your X-API-Key |
| Mime type and file name | payload.media.mimetype, payload.media.filename |
data.<type>.mime_type, data.document.filename |
| Quoted message | payload.replyTo.id |
data.context.id |
| Delivery status | message.ack, with payload.ackName set to ERROR, PENDING, SERVER, DEVICE, READ or PLAYED |
message.status, with data.status set to failed, sent, delivered or read |
| Request authentication | Optional: X-Webhook-Hmac, an HMAC SHA-512 of the body, when the session has a key |
Always: X-ZapClaw-Signature, an HMAC-SHA256 of the raw body, keyed with your signing secret (how to verify it) |
A media link from ZapClaw needs your API key, and Meta keeps received media for around 30 days, so download what you want to keep. Deliveries can arrive out of order: when order matters, sort by the top-level sequence.
What has no equivalent, and what to do instead
- Groups. Groups keep working in the WhatsApp Business app, but Meta's Cloud API does not support them on a Coexistence number: sending to a
@g.uschat and receiving group messages through the API both stop. Keep group automations off the number you move. - Free text at any time. A text or media message goes only within 24 hours of the contact's last message to you. Outside that window ZapClaw answers
422withmeta_code: 131047: send an approved template instead. - Writing first. The first message to someone who has not written to you in the last 24 hours has to be an approved template. Meta bills templates to you directly, separately from your ZapClaw plan.
- Status, channels and broadcast lists. ZapClaw has no endpoint for
status@broadcastor@newsletterchats, and Meta lists broadcast lists among what Coexistence does not support. - View once, disappearing messages and calls. Meta turns view once and disappearing messages off in one-to-one chats. Voice and video calls keep working in the app, but the Cloud API does not support them on a Coexistence number.
- Polls, mentions, presence, editing or deleting a sent message. ZapClaw has no endpoint for them. Buttons and lists go through
POST /api/v1/send/interactive. - Base64 and format conversion. Upload the file with
POST /api/v1/mediaand send themediaIdit returns, or send a public httpslink, in a format WhatsApp accepts. - Old message ids. Ids from WAHA are not Cloud API ids, so a reply cannot quote a message from before the move. New ids start with
wamid. - Contact ids. A
@lidis a hidden WhatsApp id, not a phone number. Address contacts by phone number and storedata.user_idas the durable key: a contact who adopts a WhatsApp username can arrive withdata.fromset tonull. - Volume. A Coexistence number is fixed at 20 messages per second, a Meta limit that cannot be raised, and bulk broadcasting does not fit.
- WhatsApp for Windows and WearOS. Meta does not let them link again after the move, and messages sent from them produce no webhook.
Keep using the WhatsApp Business app on the phone: Meta disconnects a Coexistence number whose app goes about 14 days without use, and ZapClaw tells your webhook with an account.account_update event (details).
A short adapter
Two functions for Node.js 18 or newer, with no dependency: the first sends where your code called /api/sendText, the second turns a ZapClaw message.received into the payload fields your flow already reads. Check the X-ZapClaw-Signature header before you trust a body.
// Sending: what was POST /api/sendText with an X-Api-Key header
const sendText = async ({ chatId, text }) => {
const res = await fetch('https://api.zapclaw.app/api/v1/send/text', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.ZAPCLAW_API_KEY,
},
body: JSON.stringify({
from: process.env.ZAPCLAW_FROM,
to: chatId.replace(/@c\.us$/, ''),
text,
}),
});
if (!res.ok) throw new Error(`ZapClaw answered ${res.status}`);
return (await res.json()).message; // message.wamid is the new message id
};
// Receiving: the payload of a WAHA message event, taken from a message.received body
const MEDIA = ['image', 'audio', 'video', 'document', 'sticker'];
const fromZapClaw = (body) => {
const d = body.data;
const media = MEDIA.includes(d.type) ? d[d.type] : null;
return {
from: `${d.from}@c.us`,
fromMe: false,
id: d.message_id,
timestamp: Number(d.timestamp),
body: d.text ? d.text.body : (media ? media.caption || '' : ''),
hasMedia: Boolean(media),
media: media ? { url: media.media_url, mimetype: media.mime_type } : null,
};
};
The full version is on GitHub: zapclaw/migrate-to-whatsapp-official-api converts text, media, statuses and webhooks and ships a small shim. A call it does not convert, such as a location, a contact card or a reaction, is refused with a clear error code: send those calls straight to ZapClaw's API. Point your flow's WAHA base URL at the shim: it forwards the calls it converts to ZapClaw and turns ZapClaw's signed webhooks back into message, message.any and message.ack events, so you can move first and rewrite later. MIT license.
If your setup is different
- Several sessions. If you ran one WAHA session per number, one ZapClaw account holds them all:
account.phone_number_idtells them apart on one webhook URL, andfrompicks the number when you send. - n8n or Make. Use a webhook trigger that receives ZapClaw's events and an HTTP request that calls the send API: n8n and Make.
- Chatwoot. Chatwoot's own WhatsApp Cloud channel talks to ZapClaw instead of Meta: Chatwoot on the official WhatsApp API.
- An AI agent behind WAHA. Dify, Flowise and Typebot each have a guide for ZapClaw: Dify, Flowise and Typebot.
What it costs
- Free: 500 messages a month and 1 number, with no card and no end date. At the limit, sending pauses and new messages are held until you subscribe.
- Business: US$ 29 per month, with 20,000 messages included and unlimited numbers.
- Agency: US$ 49 per month for agencies, with 3 clients and 60,000 messages included and unlimited numbers.
Meta bills its WhatsApp message fees to you directly, with no ZapClaw markup. Every plan and price.
Related
- Unofficial WhatsApp APIs and Meta's official API, compared: Baileys, whatsapp-web.js and WAHA against Meta's Cloud API, with sources.
- The official WhatsApp API with ZapClaw: what you get and the requirements.
- What you need to connect a number through Coexistence.
- The webhook reference, with every event and field.
- Moving from another tool: Evolution API or Z-API.
Sources
Checked on 15 October 2026. WAHA's fields can differ by engine, so check its documentation for the engine you run.
- WAHA, introduction: self-hosted, and its disclaimer about bots and unofficial clients.
- WAHA, engines: WEBJS, WPP, NOWEB and GOWS, and how each reaches WhatsApp Web.
- WAHA, send messages: endpoints, the
X-Api-Keyheader and body fields. - WAHA, receive messages: media links, replies and chat id types.
- WAHA, events: the envelope,
message,message.any,message.ackand the HMAC option. - WhatsApp Terms of Service: automated access and auto-messaging.
- Meta, onboarding WhatsApp Business app users: Coexistence, linked devices, throughput and what it does not support.
- ZapClaw: webhook reference, errors, OpenAPI file and pricing.
- zapclaw/migrate-to-whatsapp-official-api: the full mapping, with a source for every row.
Move your WAHA flows to the official API
Start on the free plan: one number, no card. Move to the Business plan when you need more numbers or more messages.
Start for free Read the webhook docs