Skip to main content
POST
/
api
/
{session}
/
presence
/
{chatId}
/
subscribe
Subscribe to presence events for the conversation
curl --request POST \
  --url https://{host}/api/{session}/presence/{chatId}/subscribe \
  --header 'apikey: <api-key>'
{
  "success": true,
  "message": "Presence subscription created successfully",
  "chatId": "5511999999999@s.whatsapp.net"
}

Description

This endpoint allows you to subscribe to receive presence updates (online/offline status) of a specific contact. After subscription, you will receive events whenever the contact goes online or offline.

URL Parameters

session
string
required
WhatsApp unique session ID
chatId
string
required
ID of the chat/contact in format 5511999999999@s.whatsapp.net

Response

{
  "success": true,
  "message": "Presence subscription created successfully",
  "chatId": "5511999999999@s.whatsapp.net"
}

Status Codes

  • 200 - Subscription created successfully
  • 400 - Invalid parameters
  • 401 - Unauthorized
  • 404 - Chat/Session not found

Usage Example

curl -X POST https://api.wappfy.com.br/api/my-session/presence/5511999999999@s.whatsapp.net/subscribe

Notas

  • After subscribing, you will receive presence events through the event stream
  • Use the /api/events/stream/{sessionId} endpoint to receive events in real time
  • Events will inform when the contact goes online (AVAILABLE) or offline (UNAVAILABLE)
  • Useful for implementing online status indicators in applications

Authorizations

apikey
string
header
required

Your Wappfy API key (get it at dash.wappfy.com.br)

Path Parameters

chatId
string
required

Conversation ID

I