TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wppconnect-team/wa-js/llms.txt
Use this file to discover all available pages before exploring further.
WPP.newsletter module exposes the WhatsApp Channels feature — previously known as newsletters — as a programmable API. Channels are one-way broadcast feeds that any WhatsApp user can follow. If you own a channel, you can create, edit, and delete it and inspect its subscriber list. If you are a follower, you can subscribe, unsubscribe, and mute notifications. The search function is available to all users and lets you discover channels from the in-app directory.
Channel IDs always end with
@newsletter (e.g. 120363xxxxxx@newsletter). Every function that accepts a newsletterId or id parameter requires this suffix.Ownership vs. following
There are two distinct relationships a WhatsApp account can have with a channel:- Owner — created the channel. Can call
edit,destroy, andgetSubscribers. - Follower — subscribed to the channel. Can call
follow,unfollow, andmute.
Functions
create
Creates a new WhatsApp Channel owned by the authenticated account and returns metadata about the newly created channel.
Display name for the new channel.
Promise<ResultCreateNewsletter>
The full channel JID, e.g.
120363xxxxxx@newsletter.Short invite code used to construct the public link.
Full public URL:
https://whatsapp.com/channel/{inviteCode}.Channel display name.
Current state of the channel (e.g.
ACTIVE).Number of followers at creation time.
The description you provided, or
null.Unix timestamp (seconds) of channel creation.
edit
Updates one or more metadata fields of a channel you own. Pass only the fields you want to change; omitted fields are left untouched.
The
@newsletter JID of the channel to edit.Promise<ResultCreateNewsletter> — the full updated channel metadata (same shape as create).
destroy
Permanently deletes a channel you own. This action cannot be undone.
The
@newsletter JID of the channel to delete. Must contain the literal string newsletter or a WPPError is thrown before the request is made.Promise<boolean> — true on success, false if the underlying request fails.
follow
Subscribes the authenticated account to a channel. The account will begin receiving channel updates in its Channels tab.
The
@newsletter JID of the channel to follow.Promise<boolean> — true on success.
Throws a typed WPPError for specific backend conditions:
| Error code | HTTP status | Meaning |
|---|---|---|
newsletter_follower_limit | 419 | Channel has reached its follower capacity |
newsletter_closed | 405 | Channel is closed to new followers |
newsletter_geosuspended | 451 | Channel is not available in your country |
newsletter_follow_failed | other | Unexpected error |
unfollow
Unsubscribes the authenticated account from a channel. Calling this function when already unfollowed is treated as a success (idempotent).
The
@newsletter JID of the channel to unfollow.Promise<boolean> — true on success or if already unfollowed.
mute
Mutes or unmutes update notifications for a channel. When muted, posts from the channel are still delivered but no notification sound or banner is shown.
The
@newsletter JID of the channel.true to mute, false to unmute. Omitting this parameter defaults to muting the channel.Promise<ChatModel> — the updated chat model for the channel.
search
Searches the WhatsApp Channel directory by keyword. Supports optional category filtering and cursor-based pagination.
Non-empty search string. Whitespace is trimmed automatically.
Promise<NewsletterSearchResult>
Array of matching channel objects.
Present when the result set can be paginated.
getSubscribers
Returns a sample of up to 9 subscribers for a channel you own. This function calls WhatsApp’s LIMITED subscription tier, which returns a representative subset rather than the full list.
The
@newsletter JID of the channel. Must contain the string newsletter.Promise<any> — the raw subscriber array from WhatsApp’s API, or false on error.
getSubscribers is only meaningful when called on a channel you own. Calling it on a channel you merely follow will either fail or return an empty array depending on the backend response.Error handling
All functions throwWPPError instances with a machine-readable code string. Catch them to branch on specific failure modes: