Skip to Content
WhatsApp API by Retention Stack

Sessions

Manage WhatsApp sessions

List sessions

GET
/v1/sessions

List only the sessions owned by your account. An empty data array means you have no sessions yet. Use each returned name in session parameters; status can be refreshed from the messaging service when available.

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.

Response Body

Owned sessions. Before creation, data is an empty array.

application/json
  1. response
success*true
Value intrue
data*array<>
timestamp*string
Formatdate-time
Example Request
curl -X GET 'https://wp-rapidapi.retentionstack.agency/v1/sessions'
Example Response
{  "success": true,  "data": [],  "timestamp": "2026-11-02T00:00:00.000Z"}

Create session

POST
/v1/sessions

Create and start one WhatsApp session. The server generates its name; save data.name and use it for later calls. A supplied name is ignored. A 403 can mean your plan already has its maximum number of sessions; reuse a session from error.details.availableSessions. A rare generated-name collision returns 409; retry creation in that case.

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.

Response Body

Session created and started. Save data.name; a requested name is ignored.

application/json
  1. response
success*true
Value intrue
data*
timestamp*string
Formatdate-time
Example Request
curl -X POST 'https://wp-rapidapi.retentionstack.agency/v1/sessions'
Example Response
{  "success": true,  "data": {    "name": "session_example_1793577600000_ab12cd",    "status": "SCAN_QR_CODE",    "me": null  },  "timestamp": "2026-11-02T00:00:00.000Z"}

Get session

GET
/v1/sessions/{session}

Read your session state. Use the name returned by session creation. Wait for WORKING before sending; if the session needs linking, request its QR or pairing code.

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/sessions/me'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}

Delete session

DELETE
/v1/sessions/{session}

Delete your session from the messaging service and the local session registry. This removes the API session; create and link a new session if you need it 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

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 DELETE 'https://wp-rapidapi.retentionstack.agency/v1/sessions/me'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}

Get session me

GET
/v1/sessions/{session}/me

Read the WhatsApp account linked to your session. This requires ownership of the session; account details depend on the messaging engine and whether linking is complete.

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/sessions/me/me'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}

Start session

POST
/v1/sessions/start

Start or recover your session using its name. Already connected sessions return their current state without restarting. An empty body auto-creates a session only when you have none; otherwise supply name. Auto-creation returns 201; existing sessions return 200.

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.

Request Body

Start a WhatsApp session

application/json
  1. body

Start a WhatsApp session

name?string

Session name to start. If omitted and you have no sessions, one will be auto-created. If omitted and you have existing sessions, you must specify which one to start.

Lengthlength <= 100

Response Body

Existing session started or its current connected state returned.

application/json
  1. response
success*true
Value intrue
data*
timestamp*string
Formatdate-time
Example Request
curl -X POST 'https://wp-rapidapi.retentionstack.agency/v1/sessions/start' \  -H 'Content-Type: application/json' \  -d '{  "name": "me"}'
Example Response
{  "success": true,  "data": {    "name": "session_example_1793577600000_ab12cd",    "status": "WORKING"  },  "timestamp": "2026-11-02T00:00:00.000Z"}

Stop session

POST
/v1/sessions/stop

Stop your named session. The optional logout flag also logs it out. Sending requires a running, linked session; start it again before sending.

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.

Request Body

Stop an active WhatsApp session

application/json
  1. body

Stop an active WhatsApp session

name*string

Session name to stop

Length1 <= length
logout?boolean

Logout the session when stopping (optional)

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/sessions/stop' \  -H 'Content-Type: application/json' \  -d '{  "name": "me"}'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}

Logout session

POST
/v1/sessions/logout

Log WhatsApp out of your named session. Link the account again with a QR or pairing code before sending more messages.

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.

Request Body

Logout from a WhatsApp session

application/json
  1. body

Logout from a WhatsApp session

name*string

Session name to logout

Length1 <= length

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/sessions/logout' \  -H 'Content-Type: application/json' \  -d '{  "name": "me"}'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}

Add session webhook

POST
/v1/sessions/{session}/webhooks

Register an HTTPS callback for your session. events defaults to ["message"]. Optional hmacKey, retries and customHeaders configure delivery. The callback receives event, session and payload fields. The default retry policy is exponential with delaySeconds=2 and attempts=3. Handle duplicate deliveries in your receiver.

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

Webhook configuration for session events

application/json
  1. body

Webhook configuration for session events

webhookUrl*string

URL to send webhook events

Formaturi
events?array<string>

Specific events to subscribe to (e.g., message.create, presence.update)

Items1 <= items
hmacKey?string

Optional HMAC key for webhook signature verification

retries?|

Optional retry configuration for webhook delivery

customHeaders?array<>

Optional custom headers to include in webhook requests

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/sessions/me/webhooks' \  -H 'Content-Type: application/json' \  -d '{  "webhookUrl": "https://your-server.example/webhooks/whatsapp",  "events": [    "message",    "message.ack",    "session.status"  ]}'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}

Delete session webhook

DELETE
/v1/sessions/{session}/webhooks

Remove a callback by sending the same webhookUrl in the JSON body. A missing registration returns 404. Other callbacks on this session remain registered.

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

Delete webhook configuration

application/json
  1. body

Delete webhook configuration

webhookUrl*string

Webhook URL to delete

Formaturi

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 DELETE 'https://wp-rapidapi.retentionstack.agency/v1/sessions/me/webhooks' \  -H 'Content-Type: application/json' \  -d '{  "webhookUrl": "https://your-server.example/webhooks/whatsapp"}'
Example Response
{  "success": true,  "data": {},  "timestamp": "2026-11-02T00:00:00.000Z"}