Reawap Developers
Reawap API
Send and receive WhatsApp messages from your own software. Link a number in the dashboard, create an API key for it, then send messages, read replies and track delivery over a simple REST API.
What you can do
At a glance
- Base URL
https://reawap.com/api/v1- Authentication
- API key, as a Bearer token
- Format
- JSON over HTTPS
- Version
- v1
- Rate limit
- 60 requests a minute per key
- Keys
- Up to 3 per number
Get started
Quick start
Send your first message in about five minutes.
- 1
Link a number
On the Numbers page, add a number and scan the QR code with WhatsApp on that phone.
- 2
Create an API key
On the API keys page, create a key for that number and copy it. It is shown only once.
- 3
Store it safely
Save it on your server as an environment variable, for example
REAWAP_API_KEY. - 4
Send a message
Run the request with your own phone number. It arrives on WhatsApp within seconds.
curl -X POST https://reawap.com/api/v1/messages \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "+254712345678", "text": "Hello from Reawap"}'Authentication
Every request needs an API key in the Authorization header as a Bearer token. The X-API-Key header also works. Keys start with rw_live_.
| Rule | Details |
|---|---|
| Number keys | Send from, and manage, the one number they were created for. Up to 3 per number. |
| Account keys | Created with "All numbers". Create, link and manage every number, and send with numberId. For platforms that onboard their own users. |
| Shown once | We keep only a hash. If you lose a key, revoke it and create a new one. |
| Instant revoke | A revoked key stops working on the next request. |
Keep keys on your server
curl https://reawap.com/api/v1/number \
-H "Authorization: Bearer rw_live_xxxxxxxxxxxxxxxxxxxxxxxx"Guides
Sending messages
Send with POST /v1/messages. The API answers at once with 202 Accepted and the message in status queued. Reawap then sends it from your number a few seconds after the previous one, so WhatsApp sees normal, human pacing.
- Use international format:
+254712345678. For local formats like0712 345 678, add"country": "KE". - Numbers without WhatsApp are refused with
not_on_whatsappbefore anything is sent. - For files, set
typeand a public httpsmediaUrl. See Send media. - Add an Idempotency-Key header so a retried request never sends twice.
curl -X POST https://reawap.com/api/v1/messages \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Idempotency-Key: order-1042-shipped" \
-H "Content-Type: application/json" \
-d '{
"to": "+254712345678",
"text": "Your order #1042 is on its way."
}'Receiving messages
When someone messages your number, you can get it in two ways.
| Method | How it works | Best for |
|---|---|---|
| Webhooks | We POST a message.received event to your URL within a second. | Production apps and chatbots |
| Polling | Call GET /v1/messages with direction=inbound and since every few seconds. | Testing, or servers without a public URL |
Photos, voice notes and documents come with a media object. Download the file from media.url with your API key, as shown in Download media.
// Receive messages without a public server: poll every few seconds.
let since = new Date().toISOString();
setInterval(async () => {
const url = `https://reawap.com/api/v1/messages?direction=inbound&since=${since}&limit=100`;
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.REAWAP_API_KEY}` },
});
const { data } = await res.json();
for (const msg of data.reverse()) { // oldest first
console.log(msg.from, msg.text);
since = msg.createdAt;
}
}, 5000);Delivery and read status
Each message you send moves through these statuses. You get a webhook at each step, or you can check with Get a message.
| Status | Meaning | Webhook event |
|---|---|---|
queued | Accepted and waiting its turn to send. | None |
sent | WhatsApp has it. One grey tick. | message.sent |
delivered | It reached their phone. Two grey ticks. | message.delivered |
read | They opened it. Blue ticks, if read receipts are on. | message.read |
failed | It could not be sent. The reason is in error. | message.failed |
Link numbers from your app
Your customers never need to open Reawap. Show the QR code inside your own app, and they link their WhatsApp in the usual way: Settings, Linked devices, Link a device.
- Create an account key on the API keys page (choose "All numbers").
- Create a number for each business you onboard.
- Start linking. The response holds the first QR code as an image.
- Show it, and refresh it every few seconds (WhatsApp replaces it about every 20 seconds), or listen for the
instance.qrwebhook. - When the person scans, the status becomes
connectedand you get theinstance.connectedwebhook. Their number can send at once.
Number status
| Status | Meaning |
|---|---|
stopped | Created or not linked yet. Call connect. |
qr | Waiting for a scan. A QR code is available. |
connecting | Scanned or reconnecting. Usually takes a few seconds. |
connected | Linked and able to send. |
disconnected | Lost the connection. Reawap reconnects by itself. |
logged_out | Removed from Linked devices on the phone. Link it again. |
banned | WhatsApp restricted the number. |
// Link a WhatsApp number from your own app, with an account key.
const api = (path, init = {}) =>
fetch(`https://reawap.com/api/v1${path}`, {
...init,
headers: { Authorization: `Bearer ${process.env.REAWAP_API_KEY}`, "Content-Type": "application/json" },
}).then((r) => r.json());
// 1. Create the number (once per business you onboard)
const number = await api("/numbers", { method: "POST", body: JSON.stringify({ name: "Mama Mboga Shop" }) });
// 2. Start linking: the answer usually holds the first QR code already
let state = await api(`/numbers/${number.id}/connect`, { method: "POST" });
// 3. Show state.qr.image in an <img> in your app, and refresh it until linked
while (state.status !== "connected") {
await new Promise((r) => setTimeout(r, 3000));
state = await api(`/numbers/${number.id}/qr`).catch(() => null) ?? state;
if (state.code === "already_connected") break; // scanned!
showQr(state.qr?.image); // your UI
}
console.log("Linked:", (await api(`/numbers/${number.id}`)).phone);Build your own inbox
Everything the Reawap inbox shows is in the API, so you can build the same experience inside your own product: a chat list with profile photos, the full conversation, the person's WhatsApp profile, replies and quoted replies.
- List chats for the chat list: each has the contact (name, phone, photoUrl), the last message and an unread count.
- Get a chat's messages to open a conversation, then mark it read.
- Get the WhatsApp profile for a contact panel: About, business profile, online or typing.
- Show typing on their phone while your user writes, then send the reply; pass
replyToto quote a message, like WhatsApp does. - Keep it live with webhooks: every message event carries
chatId, so you know which chat to update.
Profile photos
Contacts, chats and messages carry a photoUrl, and each number has profile.photoUrl. These URLs need your API key, so never put them straight into a web page: fetch them on your server, then cache and serve them (or store them in your own storage). A contact without a photo, or who only shows it to their contacts, has photoUrl: null until we can read one.
const api = (path, init = {}) =>
fetch(`https://reawap.com/api/v1${path}`, {
...init,
headers: { Authorization: `Bearer ${process.env.REAWAP_API_KEY}`, "Content-Type": "application/json" },
}).then((r) => r.json());
// 1. The chat list: names, photos, last message, unread counts.
const { data: chats } = await api("/chats?status=open");
// 2. Open a chat: its messages, newest first, then mark it read.
const chat = chats[0];
const { data: messages } = await api(`/chats/${chat.id}/messages?limit=30`);
await api(`/chats/${chat.id}/read`, { method: "POST" });
// 3. The person's WhatsApp profile: About, business details, online/typing.
const profile = await api(`/contacts/${chat.contact.id}/profile`);
// 4. While your user writes, show "typing..." on their phone.
await api(`/chats/${chat.id}/typing`, { method: "POST", body: JSON.stringify({ state: "typing" }) });
// 5. Reply, quoting their last message.
await api("/messages", {
method: "POST",
body: JSON.stringify({ to: chat.contact.phone, text: "Yes, it is back in stock.", replyTo: messages[0].id }),
});
// 6. Photos (contact.photoUrl, number.profile.photoUrl) need your key:
// load them on your server and serve or cache them for your app.
const photo = await fetch(chat.contact.photoUrl, {
headers: { Authorization: `Bearer ${process.env.REAWAP_API_KEY}` },
});Keeping your number safe
WhatsApp bans numbers that behave like spam. Reawap protects you automatically, but how you use it matters most.
| Reawap does | You should |
|---|---|
| Sends from each number a few seconds apart | Only message people who expect to hear from you |
| Refuses numbers that are not on WhatsApp | Warm up new numbers with real conversations |
| Blocks people who replied STOP | Make opting out easy, and respect it |
| Limits how fast each key can call | Spread bulk sends out, or use Campaigns |
Messages API
Send a text message
Queues a text message. It goes out through your number's paced send queue, usually within seconds. The response comes back right away with status "queued"; follow the message with webhooks or by fetching it.
Body parameters
tostringrequired- Recipient phone number in international format, like +254712345678 or 254712345678.
textstringrequired- The message, up to 4,096 characters. WhatsApp formatting like *bold* and _italic_ works.
countrystringoptional- Two-letter country code, only needed for local numbers such as 0712 345 678.
replyTostringoptional- Reply to a message: its id from a webhook or an earlier send. WhatsApp shows it quoted above yours, like tapping Reply on the phone.
Returns
curl -X POST https://reawap.com/api/v1/messages \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Idempotency-Key: order-1042-shipped" \
-H "Content-Type: application/json" \
-d '{
"to": "+254712345678",
"text": "Your order #1042 is on its way."
}'{
"id": "cmx4f2k9w0001abcd",
"direction": "outbound",
"to": "254712345678",
"chatId": "cmx6c4h7t0002chat",
"numberId": "cmx3bsp7l00022bu1",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"type": "text",
"text": "Your order #1042 is on its way.",
"media": null,
"replyTo": null,
"status": "queued",
"error": null,
"createdAt": "2026-12-01T09:30:00.000Z",
"sentAt": null,
"deliveredAt": null,
"readAt": null
}Send an image, video, audio or document
Same endpoint with a "type" and a public https link to the file. Reawap downloads it (up to 16 MB, within 20 seconds) and sends it. Links to private networks are refused.
Body parameters
tostringrequired- Recipient phone number in international format.
typestringrequired- One of image, video, audio or document.
mediaUrlstringrequired- https link to the file. It must be reachable from the internet.
textstringoptional- Caption shown under the file.
fileNamestringoptional- Name shown for documents, like invoice-1042.pdf.
replyTostringoptional- Reply to a message by its id; WhatsApp shows it quoted above the file.
Returns
curl -X POST https://reawap.com/api/v1/messages \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+254712345678",
"type": "document",
"mediaUrl": "https://example.com/invoices/1042.pdf",
"fileName": "invoice-1042.pdf",
"text": "Here is your invoice."
}'{
"id": "cmx4f2k9w0001abcd",
"direction": "outbound",
"to": "254712345678",
"chatId": "cmx6c4h7t0002chat",
"numberId": "cmx3bsp7l00022bu1",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"type": "document",
"text": "Here is your invoice.",
"media": {
"fileName": "invoice-1042.pdf",
"mimetype": "application/pdf",
"size": 48211,
"url": "https://reawap.com/api/v1/messages/cmx4f2k9w0001abcd/media",
"voiceNote": false
},
"replyTo": null,
"status": "queued",
"error": null,
"createdAt": "2026-12-01T09:30:00.000Z",
"sentAt": null,
"deliveredAt": null,
"readAt": null
}Send a voice note
type voice sends audio as a WhatsApp voice note: it shows with a play button and waveform, like one recorded on the phone. The file must be Opus audio in Ogg (.ogg, .opus) or WebM (.webm, what browsers record with MediaRecorder); Reawap repackages WebM for WhatsApp. For MP3 or M4A files use type audio, which arrives as an audio file.
Body parameters
tostringrequired- Recipient phone number in international format.
typestringrequired- voice
mediaUrlstringrequired- https link to the Ogg or WebM Opus recording.
replyTostringoptional- Reply to a message by its id; WhatsApp shows it quoted above the voice note.
Returns
curl -X POST https://reawap.com/api/v1/messages \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+254712345678",
"type": "voice",
"mediaUrl": "https://example.com/recordings/order-1042.ogg"
}'{
"id": "cmx4f2k9w0001abcd",
"direction": "outbound",
"to": "254712345678",
"chatId": "cmx6c4h7t0002chat",
"numberId": "cmx3bsp7l00022bu1",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"type": "audio",
"text": null,
"media": {
"fileName": "Voice message",
"mimetype": "audio/ogg",
"size": 18342,
"url": "https://reawap.com/api/v1/messages/cmx4f2k9w0001abcd/media",
"voiceNote": true
},
"replyTo": null,
"status": "queued",
"error": null,
"createdAt": "2026-12-01T09:30:00.000Z",
"sentAt": null,
"deliveredAt": null,
"readAt": null
}Send a sticker
type sticker sends a WhatsApp sticker. Pick one from Reawap's pack by id (see List stickers), or give mediaUrl to any JPEG, PNG, WebP or GIF picture: Reawap fits it into WhatsApp's 512 x 512 sticker format on a transparent background, and GIFs stay animated.
Body parameters
tostringrequired- Recipient phone number in international format.
typestringrequired- sticker
stickerstringoptional- A sticker id from List stickers, like karibu or order-received.
mediaUrlstringoptional- Instead of sticker: https link to a picture to turn into one.
replyTostringoptional- Reply to a message by its id.
Returns
curl -X POST https://reawap.com/api/v1/messages \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+254712345678",
"type": "sticker",
"sticker": "order-received"
}'{
"id": "cmx4f2k9w0001abcd",
"direction": "outbound",
"to": "254712345678",
"chatId": "cmx6c4h7t0002chat",
"numberId": "cmx3bsp7l00022bu1",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"type": "sticker",
"text": null,
"media": {
"fileName": "Sticker",
"mimetype": "image/webp",
"size": 24816,
"url": "https://reawap.com/api/v1/messages/cmx4f2k9w0001abcd/media",
"voiceNote": false
},
"replyTo": null,
"status": "queued",
"error": null,
"createdAt": "2026-12-01T09:30:00.000Z",
"sentAt": null,
"deliveredAt": null,
"readAt": null
}List stickers
Reawap's sticker pack, ready to send with type sticker. Each has a url to the 512 x 512 WebP image, for showing a picker in your app (it needs your API key, so load it on your server).
Returns
curl https://reawap.com/api/v1/stickers \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"data": [
{
"id": "hello",
"label": "Hello!",
"url": "https://reawap.com/api/v1/stickers/hello"
},
{
"id": "karibu",
"label": "Karibu!",
"url": "https://reawap.com/api/v1/stickers/karibu"
},
{
"id": "asante",
"label": "Asante sana",
"url": "https://reawap.com/api/v1/stickers/asante"
},
{
"id": "order-received",
"label": "Order received",
"url": "https://reawap.com/api/v1/stickers/order-received"
}
]
}Get a sticker image
The sticker as a 512 x 512 WebP image with a transparent background.
Path parameters
idstringrequired- A sticker id from List stickers.
Returns
curl https://reawap.com/api/v1/stickers/karibu \
-H "Authorization: Bearer $REAWAP_API_KEY"(image/webp, about 25 KB)List messages
Sent and received messages on your number, newest first. Filter with direction=inbound to read what people sent you. If you can't receive webhooks, poll this endpoint with since set to the time of the newest message you already have.
Query parameters
directionstringoptional- inbound for messages people sent you, outbound for messages you sent. Leave it out for both.
sincestringoptional- Only messages created after this ISO 8601 time, like 2026-12-01T09:00:00Z.
phonestringoptional- Only messages with this person, in international format.
limitintegeroptional- How many to return, 1 to 100. Default 20.
cursorstringoptional- nextCursor from the previous page, to get older messages.
Returns
A list of message objects with hasMore and nextCursor for paging.
curl https://reawap.com/api/v1/messages?direction=inbound&limit=20 \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"data": [
{
"id": "cmx4f9p2z0007efgh",
"direction": "inbound",
"from": "254712345678",
"chatId": "cmx6c4h7t0002chat",
"numberId": "cmx3bsp7l00022bu1",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"type": "text",
"text": "Is the cooking oil back in stock?",
"media": null,
"status": "received",
"error": null,
"createdAt": "2026-12-01T09:45:02.000Z",
"sentAt": null,
"deliveredAt": null,
"readAt": null
}
],
"hasMore": true,
"nextCursor": "cmx4f9p2z0007efgh"
}Get a message
Returns a message and its current status. Use it to check delivery if you do not use webhooks.
Path parameters
idstringrequired- The id returned when you sent the message, or from a webhook.
Returns
curl https://reawap.com/api/v1/messages/cmx4f2k9w0001abcd \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"id": "cmx4f2k9w0001abcd",
"direction": "outbound",
"to": "254712345678",
"chatId": "cmx6c4h7t0002chat",
"numberId": "cmx3bsp7l00022bu1",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"type": "text",
"text": "Your order #1042 is on its way.",
"media": null,
"replyTo": null,
"status": "read",
"error": null,
"createdAt": "2026-12-01T09:30:00.000Z",
"sentAt": "2026-12-01T09:30:05.000Z",
"deliveredAt": "2026-12-01T09:30:07.000Z",
"readAt": "2026-12-01T09:41:12.000Z"
}Download media
Downloads the photo, video, voice note or document of a message, sent or received. The link is also in the message's media.url. It needs your API key like every other request.
Path parameters
idstringrequired- The id of a message whose media is not null.
Returns
The file itself, with its Content-Type.
curl https://reawap.com/api/v1/messages/cmx4f9p2z0007efgh/media \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-o voice-note.oggHTTP/1.1 200 OK
Content-Type: audio/ogg; codecs=opus
Content-Length: 30447
Content-Disposition: attachment; filename="voice-note.ogg"
<file bytes>Check a number
Tells you whether a phone number has WhatsApp, without sending anything. Counts twice towards your rate limit.
Body parameters
phonestringrequired- Phone number in international format.
countrystringoptional- Two-letter country code for local numbers.
Returns
The number in international format and onWhatsApp.
curl -X POST https://reawap.com/api/v1/contacts/check \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "+254712345678"
}'{
"phone": "254712345678",
"onWhatsApp": true
}Get your number
The WhatsApp number your key sends from, and whether it is connected. Handy as a health check.
Returns
The number and its status. It can send when the status is connected.
curl https://reawap.com/api/v1/number \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"id": "cmx3bsp7l00022bu1",
"name": "Sales line",
"phone": "254712345678",
"country": "KE",
"status": "connected"
}Chats API
List chats
Your chats, most recent first, like a WhatsApp chat list: the person (with their profile photo), the last message, unread count, open or closed, starred and who is handling it. A number key sees the chats its number took part in; an account key sees all of them. Together with the webhooks, this is all you need to build your own inbox.
Query parameters
statusstringoptional- open or closed.
unreadbooleanoptional- true for chats with unread messages only.
starredbooleanoptional- true for starred chats only.
qstringoptional- Search names, numbers and the last message.
limitintegeroptional- 1 to 100. Default 30.
cursorstringoptional- nextCursor from the previous page.
Returns
curl https://reawap.com/api/v1/chats?status=open&limit=30 \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"data": [
{
"id": "cmx6c4h7t0002chat",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"country": "KE",
"subscribed": true,
"unsubscribedAt": null,
"tags": [
"vip",
"westlands"
],
"notes": "Prefers deliveries after 5 pm.",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo",
"createdAt": "2026-11-20T08:15:00.000Z"
},
"numberId": "cmx3bsp7l00022bu1",
"status": "open",
"starred": false,
"unreadCount": 2,
"lastMessageAt": "2026-12-01T09:45:02.000Z",
"lastMessagePreview": "Is the cooking oil back in stock?",
"assignedTo": {
"id": "cmx1t9a0b0004team",
"name": "Kevin Mwangi"
},
"createdAt": "2026-11-20T08:15:00.000Z"
}
],
"unreadChats": 3,
"hasMore": false,
"nextCursor": null
}Get a chat
One chat, in the same shape as the list. The chatId on every message and webhook points here.
Path parameters
idstringrequired- The chat's id.
Returns
curl https://reawap.com/api/v1/chats/cmx6c4h7t0002chat \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"id": "cmx6c4h7t0002chat",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"country": "KE",
"subscribed": true,
"unsubscribedAt": null,
"tags": [
"vip",
"westlands"
],
"notes": "Prefers deliveries after 5 pm.",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo",
"createdAt": "2026-11-20T08:15:00.000Z"
},
"numberId": "cmx3bsp7l00022bu1",
"status": "open",
"starred": false,
"unreadCount": 2,
"lastMessageAt": "2026-12-01T09:45:02.000Z",
"lastMessagePreview": "Is the cooking oil back in stock?",
"assignedTo": {
"id": "cmx1t9a0b0004team",
"name": "Kevin Mwangi"
},
"createdAt": "2026-11-20T08:15:00.000Z"
}Get a chat's messages
The conversation with one person, newest first, across all your numbers: what they sent, what you sent from the dashboard, the API or a campaign, and messages typed on the phone. Media messages carry a download link; replies carry replyTo. Page back with cursor to load older messages.
Query parameters
idstringrequired- The chat's id (path).
limitintegeroptional- 1 to 100. Default 30.
cursorstringoptional- nextCursor from the previous page, for older messages.
Returns
curl https://reawap.com/api/v1/chats/cmx6c4h7t0002chat/messages?limit=30 \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"data": [
{
"id": "cmx4f2k9w0001abcd",
"direction": "inbound",
"chatId": "cmx6c4h7t0002chat",
"numberId": "cmx3bsp7l00022bu1",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"type": "text",
"text": "Is the cooking oil back in stock?",
"media": null,
"replyTo": null,
"status": "received",
"error": null,
"createdAt": "2026-12-01T09:30:00.000Z",
"sentAt": null,
"deliveredAt": null,
"readAt": null,
"from": "254712345678"
}
],
"hasMore": true,
"nextCursor": "cmx4f2k9w0001abcd"
}Close, reopen or star a chat
Moves a chat between open and closed, or stars it. A closed chat opens again by itself when the person writes.
Body parameters
statusstringoptional- open or closed.
starredbooleanoptional- true to star, false to remove the star.
Returns
curl -X PATCH https://reawap.com/api/v1/chats/cmx6c4h7t0002chat \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "closed",
"starred": true
}'{
"id": "cmx6c4h7t0002chat",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"country": "KE",
"subscribed": true,
"unsubscribedAt": null,
"tags": [
"vip",
"westlands"
],
"notes": "Prefers deliveries after 5 pm.",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo",
"createdAt": "2026-11-20T08:15:00.000Z"
},
"numberId": "cmx3bsp7l00022bu1",
"status": "closed",
"starred": true,
"unreadCount": 2,
"lastMessageAt": "2026-12-01T09:45:02.000Z",
"lastMessagePreview": "Is the cooking oil back in stock?",
"assignedTo": {
"id": "cmx1t9a0b0004team",
"name": "Kevin Mwangi"
},
"createdAt": "2026-11-20T08:15:00.000Z"
}Mark a chat as read
Sets the unread count to 0, in your app and in the Reawap dashboard.
Path parameters
idstringrequired- The chat's id.
Returns
curl -X POST https://reawap.com/api/v1/chats/cmx6c4h7t0002chat/read \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"id": "cmx6c4h7t0002chat",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"country": "KE",
"subscribed": true,
"unsubscribedAt": null,
"tags": [
"vip",
"westlands"
],
"notes": "Prefers deliveries after 5 pm.",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo",
"createdAt": "2026-11-20T08:15:00.000Z"
},
"numberId": "cmx3bsp7l00022bu1",
"status": "open",
"starred": false,
"unreadCount": 0,
"lastMessageAt": "2026-12-01T09:45:02.000Z",
"lastMessagePreview": "Is the cooking oil back in stock?",
"assignedTo": {
"id": "cmx1t9a0b0004team",
"name": "Kevin Mwangi"
},
"createdAt": "2026-11-20T08:15:00.000Z"
}Show typing
Shows "typing..." (or "recording audio...") on the person's phone while someone in your app writes a reply, like WhatsApp does. Send typing again every few seconds while they keep typing, and paused when they stop; sending the message clears it too. It also shows your number as online for 45 seconds, which is when WhatsApp tells us that the person is typing: read it from the presence field of the contact's profile.
Body parameters
idstringrequired- The chat's id (in the path).
statestringrequired- typing, recording or paused.
Returns
curl -X POST https://reawap.com/api/v1/chats/cmx6c4h7t0002chat/typing \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "typing"
}'{
"ok": true,
"state": "typing"
}Contacts API
List contacts
Everyone who wrote to you or you messaged, with their name, tags, notes, whether they are subscribed and a link to their WhatsApp profile photo (photoUrl, null until we have it). Contacts belong to your account, so every key sees all of them.
Query parameters
qstringoptional- Search names and numbers.
tagstringoptional- Only contacts with this tag.
subscribedbooleanoptional- false for people who replied STOP.
limitintegeroptional- 1 to 200. Default 50.
cursorstringoptional- nextCursor from the previous page.
Returns
curl https://reawap.com/api/v1/contacts?tag=vip&limit=50 \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"data": [
{
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"country": "KE",
"subscribed": true,
"unsubscribedAt": null,
"tags": [
"vip",
"westlands"
],
"notes": "Prefers deliveries after 5 pm.",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo",
"createdAt": "2026-11-20T08:15:00.000Z"
}
],
"hasMore": false,
"nextCursor": null
}Get a contact
One contact, by its id or by phone number in international format (/contacts/+254712345678).
Path parameters
idstringrequired- The contact's id, or a phone number.
Returns
curl https://reawap.com/api/v1/contacts/+254712345678 \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"country": "KE",
"subscribed": true,
"unsubscribedAt": null,
"tags": [
"vip",
"westlands"
],
"notes": "Prefers deliveries after 5 pm.",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo",
"createdAt": "2026-11-20T08:15:00.000Z"
}Update a contact
Changes the name, tags and notes your team sees. subscribed: false unsubscribes the person (no campaigns, no messages until they write again). Only the person can subscribe again, by sending START, so subscribed: true is refused with consent_required.
Body parameters
namestringoptional- Up to 80 characters. Empty clears it.
tagsstring[]optional- Up to 20 tags. Replaces the current tags.
notesstringoptional- Private notes, up to 2,000 characters.
subscribedbooleanoptional- false to unsubscribe them.
Returns
curl -X PATCH https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Grace Achieng",
"tags": [
"vip",
"westlands"
]
}'{
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"country": "KE",
"subscribed": true,
"unsubscribedAt": null,
"tags": [
"vip",
"westlands"
],
"notes": "Prefers deliveries after 5 pm.",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo",
"createdAt": "2026-11-20T08:15:00.000Z"
}Get a contact's WhatsApp profile
What WhatsApp shares about the person, read through one of your connected numbers: their About text, their business profile if they use WhatsApp Business (category, description, address, email, websites, opening hours), disappearing messages, and live presence (online, typing, or last seen when they share it). Cached for a while; counts double towards the rate limit.
Path parameters
idstringrequired- The contact's id, or a phone number.
Returns
curl https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/profile \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"country": "KE",
"subscribed": true,
"unsubscribedAt": null,
"tags": [
"vip",
"westlands"
],
"notes": "Prefers deliveries after 5 pm.",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo",
"createdAt": "2026-11-20T08:15:00.000Z"
},
"available": true,
"presence": {
"status": "online",
"lastSeen": null
},
"about": "Available",
"aboutSetAt": "2026-10-02T07:11:00.000Z",
"business": {
"description": "Groceries and household goods.",
"category": "Grocery Store",
"email": "[email protected]",
"websites": [
"https://example.com"
],
"address": "Westlands, Nairobi",
"hours": [
{
"day": "mon",
"mode": "specific_hours",
"openMinute": 480,
"closeMinute": 1080
}
]
},
"disappearingSeconds": null,
"via": {
"id": "cmx3bsp7l00022bu1",
"name": "Sales line"
}
}Get a contact's profile photo
The person's WhatsApp profile photo as a JPEG, the same picture people see in WhatsApp. If we do not have it yet, it is fetched from WhatsApp first. 404 photo_not_found when they have none, or only show it to their contacts. Load it from your server (it needs your API key), then cache it; photoUrl on contacts, chats and messages points here.
Path parameters
idstringrequired- The contact's id, or a phone number.
Returns
curl https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo \
-H "Authorization: Bearer $REAWAP_API_KEY"Content-Type: image/jpeg
<the photo>Numbers API
List numbers
Every WhatsApp number in your account, with its live status. A number key sees only its own number.
Returns
curl https://reawap.com/api/v1/numbers \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"data": [
{
"id": "cmx5n1a2b0001numb",
"name": "Mama Mboga Shop",
"phone": "254712345678",
"country": "KE",
"status": "connected",
"statusReason": null,
"lastConnectedAt": "2026-12-01T09:02:10.000Z",
"createdAt": "2026-12-01T09:00:00.000Z",
"profile": {
"name": "Mama Mboga",
"about": "Fresh groceries, delivered daily",
"isBusiness": true,
"business": {
"category": "Grocery Store",
"description": "Fruit, vegetables and household goods in Westlands.",
"email": "[email protected]",
"websites": [
"https://mamamboga.co.ke"
],
"address": "Westlands, Nairobi"
},
"photoUrl": "https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/photo",
"checkedAt": "2026-12-01T09:02:30.000Z"
}
}
]
}Create a number
Adds a number to your account, ready to link. Needs an account key, and counts towards your plan's number limit. Then call connect to get its QR code.
Body parameters
namestringrequired- A name you will recognise, like the business or branch it belongs to.
Returns
curl -X POST https://reawap.com/api/v1/numbers \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Mama Mboga Shop"
}'{
"id": "cmx5n1a2b0001numb",
"name": "Mama Mboga Shop",
"phone": null,
"country": null,
"status": "stopped",
"statusReason": null,
"lastConnectedAt": null,
"createdAt": "2026-12-01T09:00:00.000Z",
"profile": null
}Start linking (get a QR code)
Starts linking a new number, or reconnects one that was linked before. It waits a few seconds for the first QR code, so the response usually contains it already. A number that is already connected is returned as it is. No body is needed.
Path parameters
idstringrequired- The number's id. With a number key you can use POST /v1/number/connect instead.
Returns
curl -X POST https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/connect \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"id": "cmx5n1a2b0001numb",
"name": "Mama Mboga Shop",
"phone": null,
"country": null,
"status": "qr",
"statusReason": null,
"lastConnectedAt": null,
"createdAt": "2026-12-01T09:00:00.000Z",
"profile": null,
"qr": {
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"refreshSeconds": 20
}
}Get the QR code
The current QR code while a number is linking. WhatsApp replaces it about every 20 seconds, so fetch it again every few seconds (or use the instance.qr webhook) until the status is connected. qr.image is a PNG data URL: put it straight into an <img> tag. Add ?format=png to get the image file itself.
Path parameters
idstringrequired- The number's id. With a number key: GET /v1/number/qr.
Returns
curl https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/qr \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"numberId": "cmx5n1a2b0001numb",
"status": "qr",
"qr": {
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"refreshSeconds": 20
}
}Link with a pairing code
For phones that cannot scan, for example when your app runs on the same phone. Returns an 8-character code; on the phone, open WhatsApp, Linked devices, Link a device, Link with phone number instead, and type it.
Body parameters
phonestringrequired- The WhatsApp number being linked, in international format.
countrystringoptional- Two-letter country code, only for local formats like 0712 345 678.
Returns
curl -X POST https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/pairing-code \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "+254712345678"
}'{
"numberId": "cmx5n1a2b0001numb",
"code": "K7Q2M9XP"
}Get a number
A number and its live status. Poll it while linking, or rely on the instance.connected webhook.
Path parameters
idstringrequired- The number's id.
Returns
curl https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"id": "cmx5n1a2b0001numb",
"name": "Mama Mboga Shop",
"phone": "254712345678",
"country": "KE",
"status": "connected",
"statusReason": null,
"lastConnectedAt": "2026-12-01T09:02:10.000Z",
"createdAt": "2026-12-01T09:00:00.000Z",
"profile": {
"name": "Mama Mboga",
"about": "Fresh groceries, delivered daily",
"isBusiness": true,
"business": {
"category": "Grocery Store",
"description": "Fruit, vegetables and household goods in Westlands.",
"email": "[email protected]",
"websites": [
"https://mamamboga.co.ke"
],
"address": "Westlands, Nairobi"
},
"photoUrl": "https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/photo",
"checkedAt": "2026-12-01T09:02:30.000Z"
}
}Rename a number
Changes the name shown in your dashboard and in API responses.
Body parameters
namestringrequired- The new name.
Returns
curl -X PATCH https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Mama Mboga, Westlands"
}'{
"id": "cmx5n1a2b0001numb",
"name": "Mama Mboga, Westlands",
"phone": "254712345678",
"country": "KE",
"status": "connected",
"statusReason": null,
"lastConnectedAt": "2026-12-01T09:02:10.000Z",
"createdAt": "2026-12-01T09:00:00.000Z",
"profile": {
"name": "Mama Mboga",
"about": "Fresh groceries, delivered daily",
"isBusiness": true,
"business": {
"category": "Grocery Store",
"description": "Fruit, vegetables and household goods in Westlands.",
"email": "[email protected]",
"websites": [
"https://mamamboga.co.ke"
],
"address": "Westlands, Nairobi"
},
"photoUrl": "https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/photo",
"checkedAt": "2026-12-01T09:02:30.000Z"
}
}Unlink a number
Removes Reawap from the phone's Linked devices. The number stays in your account and can be linked again with connect.
Path parameters
idstringrequired- The number's id. With a number key: POST /v1/number/logout.
Returns
curl -X POST https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/logout \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"id": "cmx5n1a2b0001numb",
"name": "Mama Mboga Shop",
"phone": "254712345678",
"country": "KE",
"status": "logged_out",
"statusReason": "logout_requested",
"lastConnectedAt": "2026-12-01T09:02:10.000Z",
"createdAt": "2026-12-01T09:00:00.000Z",
"profile": {
"name": "Mama Mboga",
"about": "Fresh groceries, delivered daily",
"isBusiness": true,
"business": {
"category": "Grocery Store",
"description": "Fruit, vegetables and household goods in Westlands.",
"email": "[email protected]",
"websites": [
"https://mamamboga.co.ke"
],
"address": "Westlands, Nairobi"
},
"photoUrl": "https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/photo",
"checkedAt": "2026-12-01T09:02:30.000Z"
}
}Delete a number
Unlinks the device and deletes the number. Needs an account key. Chats stay if another number also messaged those people.
Path parameters
idstringrequired- The number's id.
Returns
curl -X DELETE https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb \
-H "Authorization: Bearer $REAWAP_API_KEY"{
"id": "cmx5n1a2b0001numb",
"deleted": true
}Get a number's profile photo
The linked WhatsApp account's own profile photo as a JPEG (profile.photoUrl on the number). It is read a few seconds after the number connects. Number keys can also use /number/photo.
Path parameters
idstringrequired- The number's id.
Returns
curl https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/photo \
-H "Authorization: Bearer $REAWAP_API_KEY"Content-Type: image/jpeg
<the photo>Webhooks
Set up webhooks
Webhooks push events to your server as they happen, so you don't have to keep asking.
- Open Webhooks in the dashboard and add your https URL.
- Choose the events you want. You can limit it to one number.
- Copy the signing secret and save it on your server.
- Press Send test event to check your endpoint answers.
Your endpoint must
- Use https on a public address. Private and local addresses are refused.
- Answer with any 2xx status within 10 seconds, then do the slow work.
- Verify the signature before trusting the body.
- Ignore events it has already handled. The same
idcan arrive twice.
POST /your/webhook HTTP/1.1
Content-Type: application/json
User-Agent: Reawap-Webhooks/1.0
Reawap-Event: message.received
Reawap-Delivery: cmx4f9q1a0009ijkl
Reawap-Signature: t=1796109903,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd{
"id": "evt_8f3a2c1b9d4e5f60a7b8c9d0",
"type": "message.received",
"createdAt": "2026-12-01T09:45:03.120Z",
"numberId": "cmx3bsp7l00022bu1",
"data": {
"id": "cmx4f9p2z0007efgh",
"direction": "inbound",
"from": "254712345678",
"chatId": "cmx6c4h7t0002chat",
"numberId": "cmx3bsp7l00022bu1",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"type": "text",
"text": "Is the cooking oil back in stock?",
"replyTo": null,
"media": null,
"status": "received",
"createdAt": "2026-12-01T09:45:02.000Z"
}
}Event types
Every event has the same envelope: id, type, createdAt, numberId and data. For message events, data is a message object.
| Event | Sent when |
|---|---|
message.received | Someone sent your number a message. |
message.sent | Your message reached WhatsApp (one tick). |
message.delivered | It reached their phone (two ticks). |
message.read | They opened it (blue ticks), if read receipts are on. |
message.failed | It could not be sent. See error. |
call.incoming | Someone is calling your number on WhatsApp. data is a call object. |
call.missed | A call did not get through: missed, declined on the phone, or declined automatically. data.status says which. |
instance.qr | A new QR code is ready while a number is linking. data.qr.image is a PNG data URL. |
instance.connected | Your number connected. |
instance.disconnected | Your number disconnected or was logged out. |
Calls
WhatsApp calls cannot be answered through Reawap; they ring on the phone. call.incoming tells you a call started, and call.missed that it did not get through, so your app can call back, open a ticket or send a message. The number's call settings in the dashboard can also decline calls automatically and reply to the caller for you.
Call object
idstringoptional- Reawap's id for the call entry in the chat (it shows in the chat's messages with type call).
callIdstringoptional- WhatsApp's id for the call; the same in both events.
videobooleanoptional- A video call.
statusstringoptional- ringing (call.incoming), or missed, declined (on the phone) or declined_automatically (call.missed).
chatIdstringoptional- The chat with the caller, for Get a chat's messages.
contactobjectoptional- id, phone, name and photoUrl of the caller.
atstringoptional- When the call started, ISO 8601 in UTC.
{
"id": "evt_2b7d1e9a0c4f5a6b7c8d9e0f",
"type": "call.missed",
"createdAt": "2026-12-02T11:05:41.302Z",
"numberId": "cmx3bsp7l00022bu1",
"data": {
"id": "cmx7a1c2d0009call",
"callId": "8C1F2B0E9A7D6C5B",
"video": false,
"status": "declined_automatically",
"chatId": "cmx6c4h7t0002chat",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"at": "2026-12-02T11:05:38.000Z"
}
}Verify signatures
Every webhook request has a Reawap-Signature header like t=1796109903,v1=5257a8.... To check it:
- Take
tand the raw request body, exactly as received. - Compute the HMAC-SHA256 of
{t}.{body}with your signing secret, as hex. - Compare it with
v1using a constant-time comparison. - Reject the request if
tis more than five minutes old.
import crypto from "node:crypto";
import express from "express";
const app = express();
// Read the raw body: the signature is over the exact bytes we sent.
app.post("/webhooks/reawap", express.raw({ type: "application/json" }), (req, res) => {
const header = req.get("Reawap-Signature") ?? "";
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const body = req.body.toString("utf8");
const expected = crypto
.createHmac("sha256", process.env.REAWAP_WEBHOOK_SECRET)
.update(`${t}.${body}`)
.digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
const valid = v1 && expected.length === v1.length &&
crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
if (!fresh || !valid) return res.status(400).send("Bad signature");
const event = JSON.parse(body);
// Answer fast, then do the work (queue it) so we do not time out.
res.sendStatus(200);
handle(event);
});Retries and failures
If your endpoint doesn't answer with 2xx in time, we try again. Up to 9 attempts over about a day:
- Now
- 30 s
- 2 min
- 10 min
- 30 min
- 1 h
- 3 h
- 6 h
- 12 h
After 15 events in a row fail every attempt, the webhook is switched off and the dashboard says why. Fix your endpoint, then switch it back on. Every attempt appears in the webhook's delivery log.
Reference
The message object
Returned by the message endpoints and sent in message webhooks.
Fields
idstringoptional- Reawap's id for the message.
directionstringoptional- outbound (you sent it) or inbound (they sent it).
to / fromstringoptional- The other person's number, digits only: to for outbound, from for inbound.
contactobjectoptional- Their phone and the name saved in your contacts, if any.
typestringoptional- text, image, video, audio, document, sticker, location, contact or call.
textstring | nulloptional- The message, or the caption of a file.
mediaobject | nulloptional- fileName, mimetype, size and url of the file, for media messages, and voiceNote: true for WhatsApp voice notes (Ogg Opus audio).
statusstringoptional- queued, sent, delivered, read or failed. Inbound messages are received.
errorstring | nulloptional- Why it failed, when status is failed.
createdAt, sentAt, deliveredAt, readAtstring | nulloptional- ISO 8601 times in UTC, null until it happens.
{
"id": "cmx4f2k9w0001abcd",
"direction": "outbound",
"to": "254712345678",
"chatId": "cmx6c4h7t0002chat",
"numberId": "cmx3bsp7l00022bu1",
"contact": {
"id": "cmx6k2j8r0003cont",
"phone": "254712345678",
"name": "Grace Achieng",
"photoUrl": "https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo"
},
"type": "text",
"text": "Your order #1042 is on its way.",
"media": null,
"replyTo": null,
"status": "queued",
"error": null,
"createdAt": "2026-12-01T09:30:00.000Z",
"sentAt": null,
"deliveredAt": null,
"readAt": null
}Errors
Errors use standard HTTP status codes. The body always has a stable code for your program and a readable message for people. Codes never change; messages may.
Every response, success or error, has a Request-Id header, and errors repeat it as requestId. Log it. If you contact support about a failed request, send it and we can find exactly what happened.
When to retry
| Status | What to do |
|---|---|
| 400, 401, 403, 404, 405, 413, 415, 422 | Don't retry. Fix the request first: the same request will fail again. |
| 409 | Wait a second, then retry with the same Idempotency-Key. |
| 429 | Wait the number of seconds in Retry-After, then retry. |
| 500, 503 | Retry with backoff: 2, 4, 8 seconds and so on. Use an Idempotency-Key so a send never repeats. |
All error codes
| Status | Code | Meaning |
|---|---|---|
| 400 | validation_error | A field is missing or invalid. The message says which. |
| 400 | invalid_json | The body is not valid JSON. |
| 400 | invalid_body | The body must be a JSON object, not a list or a value. |
| 400 | invalid_characters | The request contains characters that are not allowed, such as NUL bytes. |
| 400 | invalid_idempotency_key | The Idempotency-Key header has characters that are not allowed, or is too long. |
| 401 | missing_api_key | No key in the Authorization header. |
| 401 | invalid_api_key | The key is wrong or was revoked. |
| 403 | account_suspended | The account is suspended. |
| 403 | recipient_unsubscribed | The person replied STOP. You can message them again once they write to you. |
| 400 | invalid_cursor | The cursor is not from a previous page. |
| 404 | route_not_found | There is no such endpoint. Check the path and the /v1 prefix. |
| 404 | message_not_found | No message with that id for this number. |
| 404 | chat_not_found | No chat with that id that this key can see. |
| 404 | contact_not_found | No contact with that id or phone number in your account. |
| 404 | photo_not_found | There is no profile photo, or the person only shows it to their contacts. |
| 409 | not_available | Typing cannot be shown: the number is offline, or the person replied STOP. |
| 422 | consent_required | Only the person can subscribe again, by sending START to your number. |
| 404 | media_not_found | The message has no file, or it is no longer stored. |
| 405 | method_not_allowed | Wrong HTTP method for this endpoint. The Allow header lists the right ones. |
| 409 | request_in_progress | A request with the same Idempotency-Key is still running. |
| 413 | payload_too_large | The body is over 64 KB. Send files by mediaUrl, not inside the body. |
| 415 | unsupported_media_type | Send the body as JSON with Content-Type: application/json. |
| 422 | invalid_phone | The phone number is not valid. |
| 422 | not_on_whatsapp | The number does not have WhatsApp. Nothing was sent. |
| 422 | media_unavailable | The media link could not be downloaded, or is too big. |
| 422 | unsupported_media | The file cannot be sent that way: a voice note must be Ogg or WebM Opus audio, a sticker a JPEG, PNG, WebP or GIF picture. |
| 404 | sticker_not_found | No sticker with that id. List stickers shows them. |
| 429 | rate_limited | Too many requests. Wait for Retry-After seconds. |
| 429 | too_many_failed_attempts | Too many invalid keys from your address. Wait 15 minutes. |
| 500 | internal_error | Something failed on our side. Retry; if it keeps happening, send us the requestId. |
| 400 | number_required | An account key must say which number: use /v1/numbers/{id}/... or numberId. |
| 403 | account_key_required | Creating and deleting numbers needs an account key. |
| 403 | key_scope | This number key belongs to another number. |
| 403 | plan_limit | Your plan does not allow this (numbers, messages, contacts, keys or webhooks). Upgrade on the Billing page. |
| 404 | number_not_found | No number with that id in your account. |
| 409 | already_connected | The number is already linked, so there is no QR or pairing code. |
| 409 | not_linking | No QR code: start linking with connect first. |
| 409 | qr_not_ready | The QR code is a second away. Ask again. |
| 503 | number_offline | Your number is not connected. Link it again in the dashboard. |
{
"statusCode": 422,
"code": "not_on_whatsapp",
"message": "+254700000000 is not on WhatsApp.",
"requestId": "req_2XrUt0k7z4bH"
}Rate limits
Each key can make 60 requests a minute, and each IP address 300. Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. Over the limit you get 429: wait Retry-After seconds and try again.
Checking a number counts as two requests. An address that sends many invalid keys is blocked for 15 minutes.
HTTP/1.1 429 Too Many Requests
RateLimit-Limit: 60
RateLimit-Remaining: 0
RateLimit-Reset: 23
Retry-After: 23Idempotent requests
If a request times out, you can't tell whether the message was sent. Add an Idempotency-Key header with a value unique to that message, such as your order id. Repeating the request with the same key within 24 hours returns the first response instead of sending again.
- Up to 100 letters, numbers, dots, dashes, colons or underscores.
- Requests that failed are not remembered, so you can retry them.
- A retry while the first request is still running gets
409 request_in_progress.
curl -X POST https://reawap.com/api/v1/messages \
-H "Authorization: Bearer $REAWAP_API_KEY" \
-H "Idempotency-Key: order-1042-shipped" \
-H "Content-Type: application/json" \
-d '{"to": "+254712345678", "text": "Your order has shipped."}'Pagination
List endpoints return the newest first, with data, hasMore and nextCursor. For the next, older page, call again with cursor set to nextCursor. When hasMore is false you have everything.
Security checklist
- 01
Keep keys secret
Store them in environment variables or a secret manager, never in code.
- 02
Server side only
Call the API from your server, never from a browser or mobile app.
- 03
One key per app
Use separate keys for each app and environment, so you can revoke one alone.
- 04
Verify webhooks
Check every signature and reject old timestamps.
- 05
Retry safely
Use an Idempotency-Key for any send you might retry.
- 06
Have consent
Only message people who agreed to hear from you.