Skip to Content
WhatsApp API by Retention Stack

Auth

Session authentication (QR, pairing code, captcha)

Get QR code

GET
/v1/{session}/auth/qr

Get a QR code for linking your session. STOPPED and FAILED sessions are recovered automatically. The default response wraps the engine QR object (including its data field) in data; format=binary returns image/png when QR data is available. A connected session returns 409; use it without linking again.

Authorization

BearerAuth
headerAuthorizationBearer <ch_live_... | ak_live_...>

Direct WhatsApp Session Token (Authorization: Bearer ch_live_...) or Account API Key (ak_live_...). Generated in your dashboard at https://whatsapp-messaging.retentionstack.agency/start.

Path Parameters

session*string

WhatsApp session name (1-100 characters). With a session token (ch_live_...), me targets that token's session; with an account key, use the session name.

Length1 <= length <= 100

Query Parameters

format?string

Response format: "binary" returns PNG image, "base64" returns JSON with base64 data (default)

Default"base64"
Value in"binary""base64"

Response Body

Invalid request or session not ready. Inspect error.details for validation issues, currentStatus, nextSteps or nextStep; link WhatsApp before sending.

application/json
  1. response
success*false
Value infalse
error*
timestamp*string
Formatdate-time
Example Request
curl -X GET 'https://wp-rapidapi.retentionstack.agency/v1/me/auth/qr'
Example Response
{  "success": true,  "data": {    "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"  },  "timestamp": "2026-11-02T00:00:00.000Z"}

Request pairing code

POST
/v1/{session}/auth/pairing-code

Request a phone-number pairing code for your session. Supply 10–15 digits including the country code, without + or spaces, then enter the returned code in WhatsApp Linked Devices. STOPPED and FAILED sessions recover automatically. An already connected session returns 409.

Authorization

BearerAuth
headerAuthorizationBearer <ch_live_... | ak_live_...>

Direct WhatsApp Session Token (Authorization: Bearer ch_live_...) or Account API Key (ak_live_...). Generated in your dashboard at https://whatsapp-messaging.retentionstack.agency/start.

Path Parameters

session*string

WhatsApp session name (1-100 characters). With a session token (ch_live_...), me targets that token's session; with an account key, use the session name.

Length1 <= length <= 100

Request Body

Phone number for session authorization

application/json
  1. body

Phone number for session authorization

phoneNumber*string

Phone number (10-15 digits)

Match^\d{10,15}$

Response Body

Invalid request or session not ready. Inspect error.details for validation issues, currentStatus, nextSteps or nextStep; link WhatsApp before sending.

application/json
  1. response
success*false
Value infalse
error*
timestamp*string
Formatdate-time
Example Request
curl -X POST 'https://wp-rapidapi.retentionstack.agency/v1/me/auth/pairing-code' \  -H 'Content-Type: application/json' \  -d '{  "phoneNumber": "15551234567"}'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}

Get passkey challenge

GET
/v1/{session}/auth/passkey/challenge

Use when your session status is PASSKEY_REQUIRED. Returns the WebAuthn challenge (challenge, rpId, allowCredentials, userVerification, timeout). It must be signed in a browser on web.whatsapp.com, which the WhatsApp browser extension does for you. Returns 422 when no challenge is pending.

Authorization

BearerAuth
headerAuthorizationBearer <ch_live_... | ak_live_...>

Direct WhatsApp Session Token (Authorization: Bearer ch_live_...) or Account API Key (ak_live_...). Generated in your dashboard at https://whatsapp-messaging.retentionstack.agency/start.

Path Parameters

session*string

WhatsApp session name (1-100 characters). With a session token (ch_live_...), me targets that token's session; with an account key, use the session name.

Length1 <= length <= 100

Response Body

Invalid request or session not ready. Inspect error.details for validation issues, currentStatus, nextSteps or nextStep; link WhatsApp before sending.

application/json
  1. response
success*false
Value infalse
error*
timestamp*string
Formatdate-time
Example Request
curl -X GET 'https://wp-rapidapi.retentionstack.agency/v1/me/auth/passkey/challenge'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}

Submit passkey assertion

POST
/v1/{session}/auth/passkey

Send the signed WebAuthn assertion exactly as returned by credential.toJSON(). Most sessions then move to WORKING; poll getSession to confirm. If the status becomes PASSKEY_CONFIRMATION_REQUIRED, continue with getPasskeyConfirmation.

Authorization

BearerAuth
headerAuthorizationBearer <ch_live_... | ak_live_...>

Direct WhatsApp Session Token (Authorization: Bearer ch_live_...) or Account API Key (ak_live_...). Generated in your dashboard at https://whatsapp-messaging.retentionstack.agency/start.

Path Parameters

session*string

WhatsApp session name (1-100 characters). With a session token (ch_live_...), me targets that token's session; with an account key, use the session name.

Length1 <= length <= 100

Request Body

WebAuthn assertion exactly as returned by credential.toJSON() on web.whatsapp.com

application/json
  1. body

WebAuthn assertion exactly as returned by credential.toJSON() on web.whatsapp.com

id*string
Length1 <= length
rawId*string
Length1 <= length
type*"public-key"
Value in"public-key"
response*
[key: string]?unknown

Response Body

Invalid request or session not ready. Inspect error.details for validation issues, currentStatus, nextSteps or nextStep; link WhatsApp before sending.

application/json
  1. response
success*false
Value infalse
error*
timestamp*string
Formatdate-time
Example Request
curl -X POST 'https://wp-rapidapi.retentionstack.agency/v1/me/auth/passkey' \  -H 'Content-Type: application/json' \  -d '{  "id": "AbCdEf0123456789_credential_id",  "rawId": "AbCdEf0123456789_credential_id",  "type": "public-key",  "response": {    "clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0In0",    "authenticatorData": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2M",    "signature": "MEUCIQDexampleSignature",    "userHandle": null  }}'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}
GET
/v1/{session}/auth/passkey/confirmation

Use only when your session status is PASSKEY_CONFIRMATION_REQUIRED. Returns a 4-digit code to compare with the code shown on your phone.

Authorization

BearerAuth
headerAuthorizationBearer <ch_live_... | ak_live_...>

Direct WhatsApp Session Token (Authorization: Bearer ch_live_...) or Account API Key (ak_live_...). Generated in your dashboard at https://whatsapp-messaging.retentionstack.agency/start.

Path Parameters

session*string

WhatsApp session name (1-100 characters). With a session token (ch_live_...), me targets that token's session; with an account key, use the session name.

Length1 <= length <= 100

Response Body

Invalid request or session not ready. Inspect error.details for validation issues, currentStatus, nextSteps or nextStep; link WhatsApp before sending.

application/json
  1. response
success*false
Value infalse
error*
timestamp*string
Formatdate-time
Example Request
curl -X GET 'https://wp-rapidapi.retentionstack.agency/v1/me/auth/passkey/confirmation'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}

Confirm passkey code

POST
/v1/{session}/auth/passkey/confirm

Call after you confirm the 4-digit code matches your phone. The session then continues linking; poll getSession until it is WORKING.

Authorization

BearerAuth
headerAuthorizationBearer <ch_live_... | ak_live_...>

Direct WhatsApp Session Token (Authorization: Bearer ch_live_...) or Account API Key (ak_live_...). Generated in your dashboard at https://whatsapp-messaging.retentionstack.agency/start.

Path Parameters

session*string

WhatsApp session name (1-100 characters). With a session token (ch_live_...), me targets that token's session; with an account key, use the session name.

Length1 <= length <= 100

Response Body

Invalid request or session not ready. Inspect error.details for validation issues, currentStatus, nextSteps or nextStep; link WhatsApp before sending.

application/json
  1. response
success*false
Value infalse
error*
timestamp*string
Formatdate-time
Example Request
curl -X POST 'https://wp-rapidapi.retentionstack.agency/v1/me/auth/passkey/confirm'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}