Set presence status

Learn how to update the presence status in WhatsApp using Unipile API.

Set online / offline status

By default, a connected WhatsApp account appears offline to its contacts. To show it as online, use Set Presence with online as presence. The account stays online until you set it back to offline.

curl --request POST \
  --url https://api.unipile.com/v2/acc_123456789/presence \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{ "presence": "online" }'
📘

Supported values

WhatsApp only supports online and offline. away and restricted_online return a provider/invalid_parameters error.

Set typing status

To show "typing…" to the other participants of a chat, use Set Composing Status with the chat ID and typing as action.

curl --request POST \
  --url 'https://api.unipile.com/v2/acc_123456789/chats/CHAT_ID/composing?action=typing' \
  --header 'X-API-KEY: YOUR_API_KEY'
📘

Unset typing

You don't need to clear the typing indicator: WhatsApp removes it automatically after a short time. Call the endpoint again to keep it visible. recording (voice note) is not supported on WhatsApp.

Read another user's presence

Use Get a User Presence with the provider user ID to retrieve current presence. This differs from Set Presence, which publishes the connected account's own presence. Handle unknown when the provider shares no presence information.

The response contains online, offline or unknown, and last_online_at when WhatsApp shares it. Requesting the connected account's own presence returns an error.

Instagram and WhatsApp do not report the account owner's presence. Instagram only shares another user's presence when the connected account shares its own activity status. Visibility also depends on provider privacy settings.

const response = await fetch(
  "https://api.unipile.com/v2/acc_123456789/users/user_id/presence",
  {
    method: "GET",
    headers: {
      "X-API-KEY": "YOUR_API_KEY",
    },
  },
);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
import requests

response = requests.get(
    "https://api.unipile.com/v2/acc_123456789/users/user_id/presence",
    headers={"X-API-KEY": "YOUR_API_KEY"},
    timeout=30,
)
response.raise_for_status()
data = response.json()
curl --request GET \
  --url "https://api.unipile.com/v2/acc_123456789/users/user_id/presence" \
  --header 'X-API-KEY: YOUR_API_KEY'

Did this page help you?