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.

All outgoing content goes through a single method:
client.message.send(to, content, options?): Promise<WaMessagePublishResult>
  • to — the recipient (5511999999999@s.whatsapp.net, a group ...@g.us, etc.). See JID helpers for building these.
  • content — a string, a typed content object, or a raw Proto.IMessage.
  • options — quoting, mentions, forwarding, view-once, edits, and more.
The promise resolves to a WaMessagePublishResult once the server acks:
const result = await client.message.send(jid, 'Hello!')
console.log(result.id) // the message id (stanza id)

Plain text

The simplest content is a string:
await client.message.send(jid, 'Hello from zapo!')
For more control, use the text object form — it lets you attach context info and tune link previews:
await client.message.send(jid, {
  type: 'text',
  text: 'Check this out: https://example.com',
  linkPreview: true // auto-fetch a preview
})

Replying (quoting)

Pass the original message event (or a reference) as options.quote:
client.on('message', async (event) => {
  await client.message.send(event.chatJid!, 'Replying to you', {
    quote: event
  })
})
The quote is rendered as a reply bubble referencing the original message.

Mentions

options.mentions is a list of JIDs to tag. Include the matching @number text in the body so WhatsApp renders the mention:
await client.message.send(groupJid, {
  type: 'text',
  text: 'Hey @5511999999999, welcome!'
}, {
  mentions: ['5511999999999@s.whatsapp.net']
})
Link-preview behavior is controlled per message via the text object’s linkPreview field:
ValueBehavior
undefinedFollow the global linkPreview default.
falseDisable the preview.
trueForce auto-fetch of the preview.
objectSkip the fetch and use the provided preview fields directly.
// Provide your own preview instead of fetching
await client.message.send(jid, {
  type: 'text',
  text: 'https://example.com',
  linkPreview: { title: 'Example', description: 'My custom preview' }
})
Configure the default fetcher globally with the linkPreview client option.

Forwarding

Set options.forward to mark a message as forwarded:
await client.message.send(jid, 'Forwarded text', { forward: true })
// or with a frequently-forwarded score
await client.message.send(jid, content, { forward: { score: 4 } })

Send options reference

WaSendMessageOptions (third argument) includes:
OptionTypePurpose
quoteWaIncomingMessageEvent | WaQuoteRefReply to a message.
mentionsstring[]JIDs to mention.
forwardboolean | { score }Mark as forwarded.
viewOncebooleanWrap image/video/audio as view-once.
editKeyWaSendEditKeyEdit a previously sent message (see interactive).
contextInfoWaSendContextInfoRaw context info (advanced).
idstringUse a specific message id.
ackTimeoutMs / maxAttempts / retryDelayMsnumberPer-send retry tuning.

The content union

content accepts any WaSendMessageContent. The typed variants are documented across these guides:

Media

Images, video, audio, documents, stickers.

Polls & reactions

Polls, votes, reactions, pins, edits, revokes, events.
You can always drop down to a raw Proto.IMessage for anything not covered by a typed builder:
import { proto } from 'zapo-js'

await client.message.send(jid, {
  conversation: 'Raw protobuf message'
})
Last modified on May 27, 2026