Set session presence
curl --request POST \
--url https://{host}/api/{session}/presence \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"chatId": "5511999999999@c.us"
}
'import requests
url = "https://{host}/api/{session}/presence"
payload = { "chatId": "5511999999999@c.us" }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chatId: '5511999999999@c.us'})
};
fetch('https://{host}/api/{session}/presence', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/presence",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chatId' => '5511999999999@c.us'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/presence"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/{session}/presence")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/presence")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Presence updated successfully",
"status": "AVAILABLE"
}
Presence
Set Presence of the Session
Set the presence status (online/offline) of the WhatsApp session
POST
/
api
/
{session}
/
presence
Set session presence
curl --request POST \
--url https://{host}/api/{session}/presence \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"chatId": "5511999999999@c.us"
}
'import requests
url = "https://{host}/api/{session}/presence"
payload = { "chatId": "5511999999999@c.us" }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chatId: '5511999999999@c.us'})
};
fetch('https://{host}/api/{session}/presence', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/presence",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chatId' => '5511999999999@c.us'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/presence"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/{session}/presence")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/presence")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Presence updated successfully",
"status": "AVAILABLE"
}
Description
This endpoint allows you to set the presence status of the WhatsApp session, controlling whether the account appears as available (online) or unavailable (offline) to other users.URL Parameters
Body
{
"status": "value"
}
Body Parameters
| Property | Type | Required | Description |
|---|---|---|---|
status | string | ✅ Yes | Presence status to be set. Accepted values: - AVAILABLE - Appears as available/online - UNAVAILABLE - Appears as unavailable/offline |
Response
{
"success": true,
"message": "Presence updated successfully",
"status": "AVAILABLE"
}
Status Codes
200- Presence updated successfully400- Invalid parameters (status must be AVAILABLE or UNAVAILABLE)401- Unauthorized404- Session not found
Usage Example
curl -X POST https://api.wappfy.com.br/api/my-session/presence \
-H "Content-Type: application/json" \
-d '{
"status": "AVAILABLE"
}'
const session = 'my-session';
const response = await fetch(`https://api.wappfy.com.br/api/${session}/presence`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
status: 'AVAILABLE'
})
});
const data = await response.json();
console.log(data);
import requests
session = 'my-session'
response = requests.post(
f'https://api.wappfy.com.br/api/{session}/presence',
json={'status': 'AVAILABLE'}
)
data = response.json()
print(data)
Notes
- The
AVAILABLEstatus will make the account appear as online to other users - The
UNAVAILABLEstatus will make the account appear as offline - This setting can be useful for controlling the visibility of the automation’s presence
Body
application/json
Response
201
