msgbubblesDocs

WhatsApp presence

Set a connected WhatsApp session online or offline for the number’s contacts. Not every WhatsApp number supports presence; when one doesn’t, the request returns 409 unsupported.

Set presence

POST/v1/whatsapp/sessions/:id/presence

Authenticate with your standard bearer API key. The :id path parameter is the UUID of a WhatsApp session on your account.

Request

Request body
{ "online": true }

online is required and must be a boolean. true shows the number as online to its contacts; false shows it as offline.

Example

Set a session online
curl -X POST https://api.msgbubbles.com/v1/whatsapp/sessions/00000000-0000-4000-8000-000000000001/presence \
  -H "Authorization: Bearer sk_live_…" \
  -H "content-type: application/json" \
  -d '{ "online": true }'

Response

A successful request returns 200 OK:

{
  "data": {
    "session_id": "00000000-0000-4000-8000-000000000001",
    "online": true
  },
  "request_id": "req_…"
}

Reconnect behavior

For now, this setting is not saved. A session that reconnects comes back offline, so set the presence you want again after each reconnect.

Errors

StatusCodeMeaning
404not_foundNo such session exists on this account.
409unsupportedThis session’s number doesn’t support presence.
409not_connectedThe session isn’t connected right now because it is pairing, reconnecting, or disconnected.
409no_profile_nameThe WhatsApp account has no profile name yet, and presence can’t be set without one.
502presence_failedThe presence update couldn’t be sent to WhatsApp.

Authentication, validation, and the shared error envelope are described in Authentication and Errors & limits.