API Overview
createClient(options)
Returns a WhatsmeowClient instance.
| Option | Type | Default | Description |
|---|---|---|---|
store | string | required | SQLite path or Postgres URL |
binaryPath | string | auto | Path to the Go binary |
commandTimeout | number | 30000 | IPC command timeout in ms |
Connection
init()— Open store and create whatsmeow client. Returns{ jid }if already paired.getQRChannel()— Set up QR pairing channel. Call beforeconnect().pairCode(phone)— Pair via phone number (alternative to QR). Call afterconnect().connect()— Connect to WhatsAppdisconnect()— Disconnect from WhatsApplogout()— Log out and remove deviceisConnected()— Check connection statusisLoggedIn()— Check login statuswaitForConnection(timeoutMs?)— Wait until connected and logged in, or timeoutresetConnection()— Reset the WebSocket connectionclose()— Kill the Go subprocess
Messaging
sendMessage(jid, message)— Send a typed message (conversation, extended text with replies)sendRawMessage(jid, message)— Send anywaE2E.Message-shaped JSONsendReaction(chat, sender, id, reaction)— React to a message (empty string to remove)editMessage(chat, id, message)— Edit a previously sent messagerevokeMessage(chat, sender, id)— Revoke/delete a messagemarkRead(ids, chat, sender?)— Mark messages as read
Polls
sendPollCreation(jid, name, options, selectableCount)— Create and send a pollsendPollVote(pollChat, pollSender, pollId, pollTimestamp, options)— Vote on a poll
Media
downloadMedia(msg)— Download media from a received messagedownloadAny(message)— Download media from any message type (auto-detects)downloadMediaWithPath(opts)— Download media using direct path and keysuploadMedia(path, mediaType)— Upload media for sending ("image"|"video"|"audio"|"document")
Media uses temp file paths instead of base64 to avoid bloating the IPC pipe. Upload returns { URL, directPath, mediaKey, fileEncSHA256, fileSHA256, fileLength }.
Contacts & Users
isOnWhatsApp(phones)— Check if phone numbers are on WhatsAppgetUserInfo(jids)— Get user info (status, picture ID, verified name)getProfilePicture(jid)— Get profile picture URLgetUserDevices(jids)— Get all devices for given usersgetBusinessProfile(jid)— Get business profile infosetStatusMessage(message)— Set your account's status message
Groups
createGroup(name, participants)— Create a groupgetGroupInfo(jid)— Get group metadatagetGroupInfoFromLink(code)— Get group info from an invite linkgetGroupInfoFromInvite(jid, inviter, code, expiration)— Get group info from a direct invitegetJoinedGroups()— List all joined groupsgetGroupInviteLink(jid, reset?)— Get/reset invite linkjoinGroupWithLink(code)— Join via invite linkjoinGroupWithInvite(jid, inviter, code, expiration)— Join via direct inviteleaveGroup(jid)— Leave a groupsetGroupName(jid, name)— Update group namesetGroupTopic(jid, topic, previousId?, newId?)— Update group topic (announcement text)setGroupDescription(jid, description)— Update group descriptionsetGroupPhoto(jid, path)— Update group photosetGroupAnnounce(jid, announce)— Toggle announcement modesetGroupLocked(jid, locked)— Toggle group lockedupdateGroupParticipants(jid, participants, action)— Add/remove/promote/demotegetGroupRequestParticipants(jid)— Get pending join requestsupdateGroupRequestParticipants(jid, participants, action)— Approve/reject join requestssetGroupMemberAddMode(jid, mode)—"admin_add"|"all_member_add"setGroupJoinApprovalMode(jid, enabled)— Enable/disable join approval
Communities
linkGroup(parent, child)— Link a child group to a parent communityunlinkGroup(parent, child)— Unlink a child groupgetSubGroups(jid)— Get sub-groups of a communitygetLinkedGroupsParticipants(jid)— Get participants across linked groups
Presence
sendPresence(presence)— Set online/offline statussendChatPresence(jid, presence, media?)— Set typing/recording indicatorsubscribePresence(jid)— Subscribe to a contact's presence
Newsletters
getSubscribedNewsletters()— List subscribed newslettersnewsletterSubscribeLiveUpdates(jid)— Subscribe to live updatescreateNewsletter(name, description, picture?)— Create a newsletter/channelgetNewsletterInfo(jid)— Get newsletter metadatagetNewsletterInfoWithInvite(key)— Get newsletter info from invite linkfollowNewsletter(jid)— Follow a newsletterunfollowNewsletter(jid)— Unfollow a newslettergetNewsletterMessages(jid, count, before?)— Fetch newsletter messagesgetNewsletterMessageUpdates(jid, count, opts?)— Get message updatesnewsletterMarkViewed(jid, serverIds)— Mark messages as viewednewsletterSendReaction(jid, serverId, reaction, messageId)— React to a newsletter messagenewsletterToggleMute(jid, mute)— Mute/unmute a newsletteracceptTOSNotice(noticeId, stage)— Accept a Terms of Service noticeuploadNewsletter(path, mediaType)— Upload media for newsletter messages
Privacy & Settings
getPrivacySettings()— Get all privacy settingstryFetchPrivacySettings(ignoreCache?)— Fetch from cache or serversetPrivacySetting(name, value)— Update a privacy settinggetStatusPrivacy()— Get default status audience rulessetDefaultDisappearingTimer(seconds)— Set default disappearing timersetDisappearingTimer(jid, seconds)— Set for a specific chat
Blocklist
getBlocklist()— Get blocked contactsupdateBlocklist(jid, action)— Block/unblock ("block"|"unblock")
QR & Link Resolution
getContactQRLink(revoke?)— Generate or revoke your contact QR linkresolveContactQRLink(code)— Resolve a contact QR code to user inforesolveBusinessMessageLink(code)— Resolve a business message link
Calls
rejectCall(from, callId)— Reject an incoming call
Configuration
setPassive(passive)— Set passive mode (don't receive messages)setForceActiveDeliveryReceipts(active)— Force sending delivery receipts
Message Helpers
generateMessageID()— Generate a unique message IDbuildMessageKey(chat, sender, id)— Build a protobuf message keybuildUnavailableMessageRequest(chat, sender, id)— Build a request for unavailable messagesbuildHistorySyncRequest(info, count)— Build a history sync request messagesendPeerMessage(message)— Send a message to your own devicessendMediaRetryReceipt(info, mediaKey)— Request re-upload of media from the sender
Bots
getBotListV2()— Get the list of available botsgetBotProfiles(bots)— Get profiles for specific bots
App State
fetchAppState(name, fullSync?, onlyIfNotSynced?)— Fetch app state from the servermarkNotDirty(cleanType, timestamp)— Mark an app state patch as not dirty
Decrypt / Encrypt
decryptComment(info, message)— Decrypt a comment messagedecryptPollVote(info, message)— Decrypt a poll vote messagedecryptReaction(info, message)— Decrypt a reaction messagedecryptSecretEncryptedMessage(info, message)— Decrypt a secret encrypted messageencryptComment(info, message)— Encrypt a commentencryptPollVote(info, vote)— Encrypt a poll voteencryptReaction(info, reaction)— Encrypt a reaction
Web Message Parsing
parseWebMessage(chatJid, webMsg)— Parse a WebMessageInfo (from history sync) into a message event
Generic
call(method, args)— Send any command to the Go binary (escape hatch)