Skip to main content
sock.chatModify(modification, jid) lets you send encrypted app-state updates to WhatsApp for a specific chat. Each modification is a plain object describing the operation — archive, mute, read status, delete, pin, or star.
If you send a malformed or inconsistent chatModify update, WhatsApp may log you out of all your devices and require you to log in again. Always pass the correct lastMessages array when the API requires it.

Archive a chat

Pass the most recent message in the chat as lastMessages so WhatsApp can reconcile state. Set archive: false to unarchive.

Mute / unmute a chat

Mute durations are expressed in milliseconds. Pass null to unmute immediately.

Mark a chat read or unread

Delete a message for me

This removes the message from your view only. Other participants are unaffected. Provide the message id, whether it was sent by you (fromMe), and its timestamp.

Delete a chat

Deleting a chat removes it from your chat list. Pass the last message so WhatsApp can sync the deletion correctly.

Pin / unpin a chat

Star / unstar a message

Set star: true to star messages and star: false to unstar them. You can batch multiple messages in the same call.

User queries

Check if a JID exists on WhatsApp

Query chat history

You need the oldest message currently in the chat to paginate backwards. History arrives in the messaging-history.set event — not as a return value.
Messages are delivered via the messaging-history.set event, not returned directly from fetchMessageHistory.

Fetch a user’s status text

Fetch a profile picture

Pass 'image' as the second argument to get the full-resolution photo instead of the thumbnail.

Fetch a business profile


Update your profile

Change profile status

Change profile name

Change your profile picture

Accepts the same WAMediaUpload types as media messages (Buffer, { url }, or { stream }).

Remove your profile picture