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.
Archive a chat
Pass the most recent message in the chat aslastMessages so WhatsApp can reconcile state. Set archive: false to unarchive.
Mute / unmute a chat
Mute durations are expressed in milliseconds. Passnull 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 messageid, 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
Setstar: 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 themessaging-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 sameWAMediaUpload types as media messages (Buffer, { url }, or { stream }).