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. 1

    Link a number

    On the Numbers page, add a number and scan the QR code with WhatsApp on that phone.

  2. 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. 3

    Store it safely

    Save it on your server as an environment variable, for example REAWAP_API_KEY.

  4. 4

    Send a message

    Run the request with your own phone number. It arrives on WhatsApp within seconds.

Send your first message
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_.

RuleDetails
Number keysSend from, and manage, the one number they were created for. Up to 3 per number.
Account keysCreated with "All numbers". Create, link and manage every number, and send with numberId. For platforms that onboard their own users.
Shown onceWe keep only a hash. If you lose a key, revoke it and create a new one.
Instant revokeA revoked key stops working on the next request.

Keep keys on your server

Never put an API key in a website, mobile app or public repository. Anyone who has it can send messages from your number.
Authenticated request
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 like 0712 345 678, add "country": "KE".
  • Numbers without WhatsApp are refused with not_on_whatsapp before anything is sent.
  • For files, set type and a public https mediaUrl. 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.

MethodHow it worksBest for
WebhooksWe POST a message.received event to your URL within a second.Production apps and chatbots
PollingCall 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.

Webhooks are faster and use none of your rate limit. Poll only when you can't receive webhooks.
Polling (Node.js)
// 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.

StatusMeaningWebhook event
queuedAccepted and waiting its turn to send.None
sentWhatsApp has it. One grey tick.message.sent
deliveredIt reached their phone. Two grey ticks.message.delivered
readThey opened it. Blue ticks, if read receipts are on.message.read
failedIt could not be sent. The reason is in error.message.failed

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.

  1. List chats for the chat list: each has the contact (name, phone, photoUrl), the last message and an unread count.
  2. Get a chat's messages to open a conversation, then mark it read.
  3. Get the WhatsApp profile for a contact panel: About, business profile, online or typing.
  4. Show typing on their phone while your user writes, then send the reply; pass replyTo to quote a message, like WhatsApp does.
  5. 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.

Contacts belong to your account, so any key can read them. Chats follow the key: a number key sees the chats of its own number; an account key sees every chat.
An inbox (Node.js)
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 doesYou should
Sends from each number a few seconds apartOnly message people who expect to hear from you
Refuses numbers that are not on WhatsAppWarm up new numbers with real conversations
Blocks people who replied STOPMake opting out easy, and respect it
Limits how fast each key can callSpread bulk sends out, or use Campaigns

Messages API

Send a text message

POST/v1/messages

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

A message object.

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."
  }'
202 Accepted
{
  "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

POST/v1/messages

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

A message object.

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."
  }'
202 Accepted
{
  "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

POST/v1/messages

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

A message object.

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"
  }'
202 Accepted
{
  "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

POST/v1/messages

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

A message object.

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"
  }'
202 Accepted
{
  "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

GET/v1/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

A message object.

curl https://reawap.com/api/v1/stickers \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

GET/v1/stickers/{id}

The sticker as a 512 x 512 WebP image with a transparent background.

Path parameters

idstringrequired
A sticker id from List stickers.

Returns

A message object.

curl https://reawap.com/api/v1/stickers/karibu \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
(image/webp, about 25 KB)

List messages

GET/v1/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"
200 OK
{
  "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

GET/v1/messages/{id}

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

A message object.

curl https://reawap.com/api/v1/messages/cmx4f2k9w0001abcd \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

GET/v1/messages/{id}/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.ogg
200 OK
HTTP/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

POST/v1/contacts/check

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"
  }'
200 OK
{
  "phone": "254712345678",
  "onWhatsApp": true
}

Get your number

GET/v1/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"
200 OK
{
  "id": "cmx3bsp7l00022bu1",
  "name": "Sales line",
  "phone": "254712345678",
  "country": "KE",
  "status": "connected"
}

Chats API

List chats

GET/v1/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

A message object.

curl https://reawap.com/api/v1/chats?status=open&limit=30 \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

GET/v1/chats/{id}

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

A message object.

curl https://reawap.com/api/v1/chats/cmx6c4h7t0002chat \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

GET/v1/chats/{id}/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

A message object.

curl https://reawap.com/api/v1/chats/cmx6c4h7t0002chat/messages?limit=30 \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

PATCH/v1/chats/{id}

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

A message object.

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
  }'
200 OK
{
  "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

POST/v1/chats/{id}/read

Sets the unread count to 0, in your app and in the Reawap dashboard.

Path parameters

idstringrequired
The chat's id.

Returns

A message object.

curl -X POST https://reawap.com/api/v1/chats/cmx6c4h7t0002chat/read \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

POST/v1/chats/{id}/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

A message object.

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"
  }'
200 OK
{
  "ok": true,
  "state": "typing"
}

Contacts API

List contacts

GET/v1/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

A message object.

curl https://reawap.com/api/v1/contacts?tag=vip&limit=50 \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

GET/v1/contacts/{id}

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

A message object.

curl https://reawap.com/api/v1/contacts/+254712345678 \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

PATCH/v1/contacts/{id}

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

A message object.

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"
    ]
  }'
200 OK
{
  "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

GET/v1/contacts/{id}/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

A message object.

curl https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/profile \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

GET/v1/contacts/{id}/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

A message object.

curl https://reawap.com/api/v1/contacts/cmx6k2j8r0003cont/photo \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
Content-Type: image/jpeg

<the photo>

Numbers API

List numbers

GET/v1/numbers

Every WhatsApp number in your account, with its live status. A number key sees only its own number.

Returns

A message object.

curl https://reawap.com/api/v1/numbers \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

POST/v1/numbers

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

A message object.

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"
  }'
201 Created
{
  "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)

POST/v1/numbers/{id}/connect

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

A message object.

curl -X POST https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/connect \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

GET/v1/numbers/{id}/qr

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

A message object.

curl https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/qr \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "numberId": "cmx5n1a2b0001numb",
  "status": "qr",
  "qr": {
    "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "refreshSeconds": 20
  }
}

Link with a pairing code

POST/v1/numbers/{id}/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

A message object.

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"
  }'
200 OK
{
  "numberId": "cmx5n1a2b0001numb",
  "code": "K7Q2M9XP"
}

Get a number

GET/v1/numbers/{id}

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

A message object.

curl https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

PATCH/v1/numbers/{id}

Changes the name shown in your dashboard and in API responses.

Body parameters

namestringrequired
The new name.

Returns

A message object.

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"
  }'
200 OK
{
  "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

POST/v1/numbers/{id}/logout

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

A message object.

curl -X POST https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/logout \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "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

DELETE/v1/numbers/{id}

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

A message object.

curl -X DELETE https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
{
  "id": "cmx5n1a2b0001numb",
  "deleted": true
}

Get a number's profile photo

GET/v1/numbers/{id}/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

A message object.

curl https://reawap.com/api/v1/numbers/cmx5n1a2b0001numb/photo \
  -H "Authorization: Bearer $REAWAP_API_KEY"
200 OK
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.

  1. Open Webhooks in the dashboard and add your https URL.
  2. Choose the events you want. You can limit it to one number.
  3. Copy the signing secret and save it on your server.
  4. 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 id can arrive twice.
Request headers
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
Event body
{
  "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.

EventSent when
message.receivedSomeone sent your number a message.
message.sentYour message reached WhatsApp (one tick).
message.deliveredIt reached their phone (two ticks).
message.readThey opened it (blue ticks), if read receipts are on.
message.failedIt could not be sent. See error.
call.incomingSomeone is calling your number on WhatsApp. data is a call object.
call.missedA call did not get through: missed, declined on the phone, or declined automatically. data.status says which.
instance.qrA new QR code is ready while a number is linking. data.qr.image is a PNG data URL.
instance.connectedYour number connected.
instance.disconnectedYour 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:

  1. Take t and the raw request body, exactly as received.
  2. Compute the HMAC-SHA256 of {t}.{body} with your signing secret, as hex.
  3. Compare it with v1 using a constant-time comparison.
  4. Reject the request if t is more than five minutes old.
Parse the JSON only after verifying. Re-serialised JSON will not match the signature.
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:

  1. Now
  2. 30 s
  3. 2 min
  4. 10 min
  5. 30 min
  6. 1 h
  7. 3 h
  8. 6 h
  9. 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.
202 Accepted
{
  "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

StatusWhat to do
400, 401, 403, 404, 405, 413, 415, 422Don't retry. Fix the request first: the same request will fail again.
409Wait a second, then retry with the same Idempotency-Key.
429Wait the number of seconds in Retry-After, then retry.
500, 503Retry with backoff: 2, 4, 8 seconds and so on. Use an Idempotency-Key so a send never repeats.

All error codes

StatusCodeMeaning
400validation_errorA field is missing or invalid. The message says which.
400invalid_jsonThe body is not valid JSON.
400invalid_bodyThe body must be a JSON object, not a list or a value.
400invalid_charactersThe request contains characters that are not allowed, such as NUL bytes.
400invalid_idempotency_keyThe Idempotency-Key header has characters that are not allowed, or is too long.
401missing_api_keyNo key in the Authorization header.
401invalid_api_keyThe key is wrong or was revoked.
403account_suspendedThe account is suspended.
403recipient_unsubscribedThe person replied STOP. You can message them again once they write to you.
400invalid_cursorThe cursor is not from a previous page.
404route_not_foundThere is no such endpoint. Check the path and the /v1 prefix.
404message_not_foundNo message with that id for this number.
404chat_not_foundNo chat with that id that this key can see.
404contact_not_foundNo contact with that id or phone number in your account.
404photo_not_foundThere is no profile photo, or the person only shows it to their contacts.
409not_availableTyping cannot be shown: the number is offline, or the person replied STOP.
422consent_requiredOnly the person can subscribe again, by sending START to your number.
404media_not_foundThe message has no file, or it is no longer stored.
405method_not_allowedWrong HTTP method for this endpoint. The Allow header lists the right ones.
409request_in_progressA request with the same Idempotency-Key is still running.
413payload_too_largeThe body is over 64 KB. Send files by mediaUrl, not inside the body.
415unsupported_media_typeSend the body as JSON with Content-Type: application/json.
422invalid_phoneThe phone number is not valid.
422not_on_whatsappThe number does not have WhatsApp. Nothing was sent.
422media_unavailableThe media link could not be downloaded, or is too big.
422unsupported_mediaThe 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.
404sticker_not_foundNo sticker with that id. List stickers shows them.
429rate_limitedToo many requests. Wait for Retry-After seconds.
429too_many_failed_attemptsToo many invalid keys from your address. Wait 15 minutes.
500internal_errorSomething failed on our side. Retry; if it keeps happening, send us the requestId.
400number_requiredAn account key must say which number: use /v1/numbers/{id}/... or numberId.
403account_key_requiredCreating and deleting numbers needs an account key.
403key_scopeThis number key belongs to another number.
403plan_limitYour plan does not allow this (numbers, messages, contacts, keys or webhooks). Upgrade on the Billing page.
404number_not_foundNo number with that id in your account.
409already_connectedThe number is already linked, so there is no QR or pairing code.
409not_linkingNo QR code: start linking with connect first.
409qr_not_readyThe QR code is a second away. Ask again.
503number_offlineYour number is not connected. Link it again in the dashboard.
422 Unprocessable Entity
{
  "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.

The rate limit is how often you can call the API. Messages still leave your number a few seconds apart, however fast you call it.
Rate limit headers
HTTP/1.1 429 Too Many Requests
RateLimit-Limit: 60
RateLimit-Remaining: 0
RateLimit-Reset: 23
Retry-After: 23

Idempotent 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.
Safe to retry
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.