wapi.

Quickstart

From zero to a sent message, with a real number or a fake one.

1. Get a connected session

Two ways, and the second needs no phone.

Open the dashboard, create a session, press Connect, and scan the QR with WhatsApp → Settings → Linked devices. The code refreshes about every twenty seconds and updates live. Once it shows connected, copy the session API key from that page.

2. Send something

curl -X POST https://api.wapi.crafter.run/api/send-message \
  -H "Authorization: Bearer $KEY" \
  -H 'Content-Type: application/json' \
  -d '{"to":"+51999888777","text":"hello from wapi"}'

3. Read the response

{ "success": true,
  "data": { "msgId": 100024, "jid": "+51999888777", "status": "in_progress" } }

Every send returns an integer msgId from wapi's own sequence — not WhatsApp's message id. You use it for replyTo and for GET /api/messages/{msgId}/info, which returns both identifiers side by side:

{
  "success": true,
  "data": {
    "remoteJid": "51999888777@s.whatsapp.net",
    "id": "3EB0A9C1...",
    "msgId": 100024,
    "key": { "id": "3EB0A9C1...", "fromMe": true,
             "remoteJid": "51999888777@s.whatsapp.net" },
    "message": { "conversation": "hello from wapi" },
    "messageTimestamp": "1787537909",
    "status": 2
  }
}

Two fields on /info that catch people out

Both follow WhatsApp's own record rather than wapi's.

messageTimestamp is a string, because it is a protobuf 64-bit integer and JSON cannot hold one as a number. status is WhatsApp's numeric acknowledgement — 0 error, 1 pending, 2 sent, 3 delivered, 4 read — not the word a send returns.

What status: "in_progress" means

A send returns as soon as wapi has accepted the message, not when WhatsApp has delivered it. That is why there is a msgId to reconcile with: if a send times out, the request failed, which is not the same as the message not arriving. Check /info before re-sending — the instinct to just run it again is how the same message reaches a customer twice.

Next

On this page