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
{ "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
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
| Status | Code | Meaning |
|---|---|---|
| 404 | not_found | No such session exists on this account. |
| 409 | unsupported | This session’s number doesn’t support presence. |
| 409 | not_connected | The session isn’t connected right now because it is pairing, reconnecting, or disconnected. |
| 409 | no_profile_name | The WhatsApp account has no profile name yet, and presence can’t be set without one. |
| 502 | presence_failed | The presence update couldn’t be sent to WhatsApp. |
Authentication, validation, and the shared error envelope are described in Authentication and Errors & limits.