Clear Chat

Supported & Tested

Clear all messages in a chat from the linked WhatsApp session.

POSThttps://api.waplix.io/api/v1/chats/clear
Authentication
Authorization: Bearer YOUR_API_KEY
Parameters Specification
instance_id
stringReq

Required Waplix instance id

chat_id
stringReq

Required phone number, @s.whatsapp.net, @g.us, or @lid chat id

experimental
booleanReq

Required. Must be true to enable clear chat.

Usage Notes
Requires experimental=true. A valid last message key must exist for the target chat. If no last message is available, the API returns a clear error. This action clears chat messages from the linked WhatsApp session and is destructive.
Request Payload Example
Request
curl -X POST "https://api.waplix.io/api/v1/api/v1/chats/clear" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "instance_id": "demo_instance",
  "chat_id": "15551234567@s.whatsapp.net",
  "experimental": true
}'
Success Response
Response · 200 OK
{
  "success": true,
  "data": {
    "instance_id": "demo_instance",
    "input_chat_id": "15551234567@s.whatsapp.net",
    "phone_chat_id": "15551234567@s.whatsapp.net",
    "resolved_chat_id": "15551234567@s.whatsapp.net",
    "lid_chat_id": null,
    "resolution_source": "stored_chat_id",
    "display_id": "15551234567@s.whatsapp.net",
    "chat_id": "15551234567@s.whatsapp.net",
    "status": "cleared",
    "last_message_id": "MSG_DEMO_LAST"
  }
}
Was this page helpful?