Skip to main content

Documentation Index

Fetch the complete documentation index at: https://zapo.to/llms.txt

Use this file to discover all available pages before exploring further.

Per-chat settings live on client.chat (WaAppStateMutationCoordinator). These are app-state mutations — they sync across all your linked devices, and changes made elsewhere arrive back as the mutation event.
These operations affect your account’s view (and your other devices). They do not change anything for the other participants — e.g. deleting a chat doesn’t delete it for them. For delete-for-everyone, use a revoke.

Mute

// Mute for 8 hours
await client.chat.setChatMute(chatJid, true, Date.now() + 8 * 3600_000)

// Unmute
await client.chat.setChatMute(chatJid, false)
muteEndTimestampMs is required when muting (epoch ms). For “mute forever”, pass a far-future timestamp. The client does not auto-unmute when the timer expires — that’s when WhatsApp re-enables notifications.

Pin & archive

await client.chat.setChatPin(chatJid, true)      // pin
await client.chat.setChatArchive(chatJid, true)  // archive
Pin and archive are mutually exclusive — pinning a chat clears its archive flag and vice-versa. WhatsApp caps the number of pinned chats server-side.

Read / unread

await client.chat.setChatRead(chatJid, true)   // mark read
await client.chat.setChatRead(chatJid, false)  // mark unread

Lock

await client.chat.setChatLock(chatJid, true)
Locking also clears archive and pin.

Star a message

A message is identified by a WaAppStateMessageKey:
interface WaAppStateMessageKey {
  chatJid: string
  id: string            // the message (stanza) id
  fromMe: boolean
  participantJid?: string // group sender
}

await client.chat.setMessageStar(
  { chatJid, id: stanzaId, fromMe: false, participantJid: senderJid },
  true
)

Clear & delete

// Clear messages but keep the chat (local-only)
await client.chat.clearChat(chatJid, { deleteStarred: false, deleteMedia: true })

// Delete the chat entirely (removes it from the list + stored messages)
await client.chat.deleteChat(chatJid, { deleteMedia: true })
clearChat keeps starred messages and media by default; set deleteStarred / deleteMedia to wipe those too. Neither leaves a group — use client.group.leaveGroup for that.

Delete a message for me

Removes a single message from your own device(s) only — recipients still see it:
await client.chat.deleteMessageForMe(
  { chatJid, id: stanzaId, fromMe: false },
  { deleteMedia: true }
)
To delete for everyone instead, send a revoke.

Beyond the helpers

The methods above are typed shortcuts. For anything without a dedicated helper — contacts, labels, quick replies, status privacy, and the full list of app-state schemas — use the generic client.chat.set() / client.chat.remove(). See the chat mutations reference.

Reacting to changes

When a chat setting changes on another device, you receive a mutation event:
client.on('mutation', (event) => {
  console.log(event.collection, event.operation, event.index)
})
Last modified on May 27, 2026