Skip to main content
PUT
/
api
/
{session}
/
labels
/
chats
/
{chatId}
Save labels for the conversation
curl --request PUT \
  --url https://{host}/api/{session}/labels/chats/{chatId} \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "labels": [
    {
      "id": "1"
    }
  ]
}'
{
  "success": true,
  "chatId": "5511999999999@s.whatsapp.net",
  "labelId": "label123",
  "action": "add"
}

Description

This endpoint allows you to add or remove a label from a specific chat, allowing you to organize and categorize your chats.

URL Parameters

session
string
required
WhatsApp unique session ID
chatId
string
required
ID of the chat (JID of the contact or group)

Request Body

labelId
string
required
ID of the label to be added or removed
action
string
required
Action to be executed: “add” or “remove”

Response

success
boolean
Indicates if the operation was executed successfully
{
  "success": true,
  "chatId": "5511999999999@s.whatsapp.net",
  "labelId": "label123",
  "action": "add"
}

Status Codes

  • 200 - Operation executed successfully
  • 400 - Invalid parameters
  • 401 - Unauthorized
  • 404 - Chat or label not found

Usage Example

curl -X PUT https://api.wappfy.com.br/api/my-session/labels/chats/5511999999999@s.whatsapp.net \
  -H "Content-Type: application/json" \
  -d '{
    "labelId": "label123",
    "action": "add"
  }'

Authorizations

apikey
string
header
required

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

Path Parameters

chatId
string
required

Conversation ID

Body

application/json
labels
object[]
required
I