Skip to Content
WhatsApp API by Retention Stack

Quickstart

Link a WhatsApp number and send a message.

1. Sign in

Open the console and sign in. Your first session is created for you, and the console shows its session token. A session is one WhatsApp number.

Prefer the API? Create a session with your account key:

curl -X POST https://wp-rapidapi.retentionstack.agency/v1/sessions \
  -H "Authorization: Bearer ak_live_YOUR_ACCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Save data.name and data.channel_token from the response. The server generates the name; a name you send is ignored. channel_token is the new session's token, used in step 3. See Create a session from code for limits.

Scan the QR code in the console (WhatsApp → Settings → Linked devices), or request a pairing code. See Sessions. If WhatsApp asks for a passkey, follow Passkey linking.

3. Send a message

With a session token you do not need to name the session: it is filled in for you.

curl -X POST https://wp-rapidapi.retentionstack.agency/v1/sendText \
  -H "Authorization: Bearer ch_live_YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"chatId": "15551234567", "text": "Your order is ready for collection."}'

chatId is the recipient's number with country code. A successful response means the message was accepted, not delivered; confirm delivery with the message.ack webhook.

Keep tokens on your server, for example in an environment variable. Never ship them in browser or mobile code.

Was this page helpful?

On this page