open-wa
DocsAPI reference

BaseClient

The generated flat client, its dispatch contract, and the full method table.

BaseClient

BaseClient is generated from the registry. Each method is a one-line binding, for example:

/** Sends a text message to a chat */
public sendText = implementMethod(Methods.sendText);

At runtime each call normalizes arguments, validates them with the method's Zod input schema, then dispatches to execute(meta.wapiOverride ?? meta.functionName, validatedParams) (falling back to pup() page evaluation). See Argument normalization.

Method dispatch table

MethodNamespaceDispatch targetParameter orderOutput
acceptCallcallsacceptCallcall, media{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string
addLabellabelsaddLabellabel, chatIdboolean
addParticipantgroupsaddParticipantgroupId, contactIdboolean
approveGroupJoinRequestgroupsapproveGroupJoinRequestgroupId, contactIdstring | boolean
archiveChatchatsarchiveChatchatIdboolean
blockContactcontactscontactBlockcontactIdboolean
cancelEventeventscancelEventeventIdboolean
checkNumberStatuscontactscheckNumberStatuscontactIdNumberCheck
checkReadReceiptscontactscheckReadReceiptscontactIdboolean | string
clearCallAudiocallsclearCallAudiocall{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string
clearChatchatsclearChatchatIdboolean
createGroupgroupscreateGroupname, contactsGroupCreationResult | null
decryptMediamediadecryptMediamessageDataURL
deleteAllStatusstatusdeleteAllStatus-boolean
deleteChatchatsdeleteChatchatIdboolean
deleteMessagemessagesdeleteMessagechatId, messageId, onlyLocalboolean
deleteStatusstatusdeleteStatusstatusesToDeleteboolean
demoteParticipantgroupsdemoteParticipantgroupId, contactIdboolean | string
downloadMediamediadownloadMediamessage, pathstring
editEventeventseditEventeventId, changesboolean
editMessagemessageseditMessagemessageId, newContentboolean
endCallcallsendCallcall{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string
forwardMessagesmessagesforwardMessagesto, messages, skipMyMessagesMessageIdReturn[] | boolean
getActiveCallcallsgetActiveCall-{ id: string; sessionId: string; generation: string; peer: string; state: string; direction: "incoming" | "outgoing"; video: boolean; terminal: boolean; observedAt: number | "Infinity" | "-Infinity" | "NaN"; endReason?: { code: string; message: string; source: "local" | "media" | "license" | "session" | "whatsapp" } | null; media?: { state: "attached" | "ended"; reason?: string | null } | null
getAlbumMessagesmessagesgetAlbumMessagesmessageIdMessage[] | false
getAllChatIdschatIdsgetAllChatIds-ChatId[]
getAllChatschatsgetAllChatswithNewMessagesOnlyChat[]
getAllCommunitiescommunitiesgetAllCommunities-GroupChatId[]
getAllContactscontactsgetAllContacts-Contact[]
getAllGroupsgroupsgetAllGroupswithNewMessagesOnlyChat[]
getAllLabelslabelsgetAllLabels-Label[]
getAllMessagesmessagesgetAllMessageschatId, includeMe, includeNotificationsMessage[]
getBatteryLevelsessiongetBatteryLevel-number
getBlockedIdscontactsgetBlockedIds-ContactId[] | false
getBusinessProductsbusinessgetBusinessProfilesProductscontactIdProduct[] | false
getBusinessProfilebusinessgetBusinessProfilecontactIdBusinessProfile
getCallCapabilitiescallsgetCallCapabilities-{ control: boolean; audio: boolean; video: boolean; reason?: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" } }
getChatchatsgetChatchatIdChat | null | undefined | false
getChatsByLabellabelsgetChatsByLabellabelChat[]
getChatWithNonContactschatsgetChatWithNonContacts-Contact[]
getCommonGroupscontactsgetCommonGroupscontactIdCommonGroup[] | false
getCommunityAdminIdscommunitiesgetCommunityAdminIdscommunityIdCommunityAdminIds[]
getCommunityAdminscommunitiesgetCommunityAdminscommunityIdCommunityAdmins[]
getCommunityInfocommunitiesgetCommunityInfocommunityIdCommunityMetadata
getCommunityParticipantIdscommunitiesgetCommunityParticipantIdscommunityIdCommunityParticipantIds[]
getCommunityParticipantscommunitiesgetCommunityParticipantscommunityIdCommunityParticipants[]
getConnectionStatesessiongetConnectionState-string
getContactcontactsgetContactcontactIdContact | null
getEventeventsgetEventeventIdWhatsAppEvent | null
getEventResponseseventsgetEventResponseseventIdEventResponse[]
getEventseventsgetEventschatId, optionsEventPage
getFeaturessessiongetFeatures-FeatureFlags
getGroupAdminsgroupsgetGroupAdminsgroupIdContactId[]
getGroupInfogroupsgetGroupInfogroupId{ title: string; description?: string | null } | string | null
getGroupInviteLinkgroupsgetGroupInviteLinkgroupIdstring
getGroupMembersgroupsgetGroupMembersgroupIdContact[]
getGroupMembersIdgroupsgetGroupMembersIdgroupIdContactId[]
getHostNumbersessiongetHostNumber-string
getKickedGroupsgroupsgetKickedGroups-GroupChatId[]
getLicenseFeaturessessiongetLicenseFeatures-{ status: "valid" | "missing" | "invalid" | "expired" | "metadata_only"; keyType: string | null; expiresAt: number | "Infinity" | "-Infinity" | "NaN" | null; features: Record<string, boolean> }
getLicenseTypesessiongetLicenseType-LicenseType | false
getLoadedMessageCountsessiongetAmountOfLoadedMessages-number
getMesessiongetMe-HostAccount
getMessageByIdmessagesgetMessageByIdmessageIdMessage | null | false
getMessageInfomessagesgetMessageInfomessageIdMessageInfo
getMessagesForLLMmessagesgetGptArraychatId, lastLLMMessage[]
getMyLastMessagemessagesgetMyLastMessagechatIdMessage | undefined
getNumberProfilecontactsgetNumberProfilecontactIdNumberProfile
getOrderbusinessgetOrderidOrder
getPollResultsmessagesgetPollResultsmessageIdPollResults
getProcessStatssessiongetProcessStats-ProcessStats
getProfilePicturecontactsgetProfilePicFromServerchatIdstring
getSnapshotsessiongetSnapshotchatId, width, heightstring
getStarredMessagesmessagesgetStarredMessageschatIdMessage[]
getStatusmystatusgetStatuscontactIdContactStatus
getStoriesstatusgetStories-Story[]
getUnsentMessagesmessagesgetUnsentMessages-Message[]
getUserAgentsessiongetGeneratedUserAgentuserAgentstring
getVCardsmessagesgetVCardsmessageIdstring[]
getWAVersionsessiongetWAVersion-string
healthChecksessionhealthCheck-HealthCheck
isChatOnlinechatsisChatOnlinechatIdboolean | string
isPluggedsessiongetIsPlugged-boolean
joinGroupViaLinkgroupsjoinGroupViaLinklink, returnChatObjGroupChatId | boolean | number | Chat
leaveGroupgroupsleaveGroupgroupIdvoid
loadEarlierMessagesmessagesloadEarlierMessageschatId, count, includeMeMessage[]
markAsReadchatsmarkAsReadchatIdboolean
markAsUnreadchatsmarkAsUnreadchatIdboolean
muteCallcallsmuteCallcall, muted{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string
muteChatchatsmuteChatchatId, muteDurationstring | boolean | number
observeCallAudiocallsobserveCallAudiocall, speaker{ ok: true; status: "requested"; observerId: string } | { ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string
pinChatchatspinChatchatIdboolean
pinMessagemessagespinMessagemessageId, durationboolean
postImageStatusstatuspostImageStatusimage, captionMessageId | string | boolean
postTextStatusstatuspostTextStatustext, backgroundColor, fontMessageId | string | boolean
postVideoStatusstatuspostVideoStatusvideo, captionMessageId | string | boolean
promoteParticipantgroupspromoteParticipantgroupId, contactIdboolean | string
reactmessagesreactmessageId, emojiboolean
rejectCallcallsrejectCallcall{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string
rejectGroupJoinRequestgroupsrejectGroupJoinRequestgroupId, contactIdstring | boolean
removeLabellabelsremoveLabellabel, chatIdboolean
removeParticipantgroupsremoveParticipantgroupId, contactIdboolean
requestPhoneNumbercontactsrequestPhoneNumbertostring
respondToEventeventsrespondToEventeventId, responseboolean
revokeGroupInviteLinkgroupsrevokeGroupInviteLinkgroupIdstring | boolean
sendAdvancedButtonsmessagessendAdvancedButtonsto, body, buttons, text, footer, filenameMessageIdReturn | boolean
sendAlbummessagessendAlbumto, media, caption, quotedMsgIdAlbumSendResult
sendAudiomessagessendAudioto, file, filename, optionsMessageIdReturn | boolean
sendBannermessagessendBannerto, base64MessageIdReturn | boolean
sendButtonsmessagessendButtonsto, body, buttons, title, footerMessageIdReturn | boolean
sendContactmessagessendContactto, contactIdMessageIdReturn | boolean | (MessageIdReturn | boolean)[]
sendEventeventssendEventto, eventstring
sendFilemessagessendFileto, file, filename, optionsMessageIdReturn | boolean
sendFileFromUrlmessagessendFileFromUrlto, url, filename, options, headersMessageIdReturn | string | boolean
sendImagemessagessendImageto, file, filename, optionsMessageIdReturn | boolean
sendInteractivemessagessendInteractiveto, contentstring
sendLinkWithAutoPreviewmessagessendLinkWithAutoPreviewto, url, text, thumbnail, quotedMsgId, customSizeMessageIdReturn | boolean
sendListMessagemessagessendListMessageto, sections, title, description, actionTextMessageIdReturn | boolean
sendLocationmessagessendLocationto, lat, lng, loc, address, urlMessageIdReturn | boolean
sendMessageWithThumbmessagessendMessageWithThumbthumb, url, title, description, content, to, quotedMsgId, customSizeMessageIdReturn | boolean
sendMultipleContactsmessagessendMultipleContactsto, contactIdsMessageIdReturn | boolean
sendPaymentRequestmessagessendPaymentRequestto, amount, currency, messageMessageIdReturn | boolean
sendPollmessagessendPollto, name, options, configMessageIdReturn | boolean
sendPttmessagessendPttto, file, optionsMessageIdReturn | boolean
sendRawMessagemessagessendRawMessageto, payloadstring
sendReplyWithMentionsmessagessendReplyWithMentionsto, content, replyMessageId, hideTags, mentionsMessageIdReturn | boolean
sendSeenmessagessendSeenchatIdboolean
sendStickermessagessendStickerJobto, input, jobMessageId
sendTextmessagessendTextto, content, optionsMessageId
sendTextWithMentionsmessagessendTextWithMentionsto, content, hideTags, mentionsMessageIdReturn | boolean
sendVCardmessagessendVCardto, vcard, contactName, contactNumberMessageIdReturn | boolean
sendVideoAsGifmessagessendVideoAsGifto, file, filename, optionsMessageIdReturn | boolean
sendYouTubeLinkmessagessendYoutubeLinkto, url, text, thumbnail, quotedMsgId, customSizeMessageIdReturn | boolean
setCallMediacallssetCallMediacall, media{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string
setChatEphemeralchatssetChatEphemeralchatId, ephemeralboolean
setGroupDescriptiongroupssetGroupDescriptiongroupId, descriptionboolean
setGroupEditToAdminsOnlygroupssetGroupEditToAdminsOnlygroupId, onlyAdminsboolean
setGroupIcongroupssetGroupIcongroupId, imageboolean
setGroupTitlegroupssetGroupTitlegroupId, titleboolean
setGroupToAdminsOnlygroupssetGroupToAdminsOnlygroupId, onlyAdminsboolean
setMyNamesessionsetMyNamenameboolean
setMyStatussessionsetMyStatusstatusTextboolean
setProfilePicturesessionsetProfilePicimageboolean
sharePhoneNumbercontactssharePhoneNumbertostring
starMessagemessagesstarMessagemessageIdboolean
startCallcallsstartCallto, microphone, speaker, camera{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string
stopCallAudioObservercallsstopCallAudioObservercall, observerId{ ok: true; status: "requested"; callId?: string | null } | { ok: false; status: "unavailable" | "failed" | "unknown"; reason: { code: string; message: string; status: number | "Infinity" | "-Infinity" | "NaN" }; callId?: string
unarchiveChatchatsunarchiveChatchatIdboolean
unblockContactcontactscontactUnblockcontactIdboolean
unmuteChatchatsunmuteChatchatIdstring | boolean | number
unpinChatchatsunpinChatchatIdboolean
unpinMessagemessagesunpinMessagemessageIdboolean
unstarMessagemessagesunstarMessagemessageIdboolean
voteOnPollmessagesvoteOnPollmessageId, optionIdsboolean

Was this helpful?

Your answer includes the page path and docs version.

On this page