Post to a WhatsApp Channel from an Activepieces flow

Post to your WhatsApp Channel from an Activepieces flow whenever a blog post, release or product goes live, with a link preview that sends followers on. The channel id is the recipient, an HTTP piece sends the post to Wapito, and a Code piece reads the response so a refused post is caught rather than lost.

Before you start

  • An Activepieces workspace, cloud or self-hosted, where you can create flows and connections.
  • A connected Wapito channel whose linked number owns or administers the WhatsApp Channel you want to post to.
  • A trigger that carries the title, the summary and the URL of what was published, such as an RSS piece, a CMS webhook or a schedule.

Step by step in Activepieces

  1. Store the token as a Bearer connection on the HTTP piece

    Add the HTTP piece to a flow, pick Send HTTP request, and under authentication choose Bearer token; Activepieces saves it as a connection you name once and reuse in every step and every flow. The token is then out of the step configuration, which matters when you export a flow or share the project with someone who should be able to edit the flow but not read the token.

    Field map
    Wapito fieldWhere it comes from
    AuthorizationBearer connection "Wapito" — value: your channel token
  2. Look up the WhatsApp Channel id once

    Run a one-off flow, or use the same HTTP piece in a test step, with GET https://api.wapito.com/v1/newsletters and the Wapito connection. The response lists every Channel the linked number belongs to with its role; take the id of the one where role is owner or admin, which ends in @newsletter, and keep it in a flow variable or a Storage piece so the send step never carries a hard-coded id.

    Field map
    Wapito fieldWhere it comes from
    channel_idnewsletters[].id where role is owner or admin — for example 120363099887766554@newsletter
  3. Add the trigger and pull the post's fields

    Use the piece that knows something was published: the RSS piece polling your feed, a Webhook piece your CMS calls, or a Schedule piece for a weekly round-up. Map the title, a one-line summary and the canonical URL from the trigger output with the data selector. Followers cannot reply to a Channel post, so the summary should stand on its own and the link should be the call to action.

    Field map
    Wapito fieldWhere it comes from
    summary{{trigger.summary}} — one or two sentences
    title{{trigger.title}} — the headline of the post
    url{{trigger.link}} — where the preview should send people
  4. Send the post as a link message to the Channel

    Add the HTTP piece with Send HTTP request, method POST, URL https://api.wapito.com/v1/messages/link and the Wapito connection. Set the body type to JSON and map the fields: the Channel id as the recipient, the summary as the body, the URL, and a title and an image for the preview card. A link post with a preview is the format that moves followers off WhatsApp, which is usually the point of publishing there.

    Field map
    Wapito fieldWhere it comes from
    body{{trigger.summary}} — the text above the preview
    description{{trigger.summary}} — optional preview description
    image{{trigger.image}} — optional preview image URL
    title{{trigger.title}} — the preview headline
    to{{channel_id}} — the @newsletter id
    url{{trigger.link}}
  5. Read the response in a Code piece

    Add a Code piece after the send that receives the HTTP step's output and returns the message id when the status is 201, or throws with the error code from the body otherwise. Throwing is deliberate: a failed step shows red in the run history and can trigger a retry or a notification, whereas a flow that ends quietly on a refused post is a Channel that silently stopped publishing.

    Field map
    Wapito fieldWhere it comes from
    error.codeinputs.response.body.error.code on any other status
    message_idinputs.response.body.id on a 201
  6. Space the posts out and keep them self-contained

    Channel posts flow through the same per-channel send queue as ordinary messages, so a trigger that fires for every item in a bulk import will queue dozens of posts at once. Add a Delay piece between posts when the trigger can batch, and let Wapito's own pacing handle the rest. Keep each post complete in itself: there is no reply, no thread and no way for a follower to ask what a post meant.

    Field map
    Wapito fieldWhere it comes from
    Delay pieceA minute or more between posts when a trigger can fire in bulk

Test it

Publish a test item on the trigger source, or run the flow manually with sample data. The HTTP step should return a 201 with a message id, the Code piece should pass the id through, and the post should appear in the Channel on a phone that follows it, with the link preview showing the title and image you mapped.

Errors you may hit

Frequently asked questions

Why is there no dedicated publish endpoint for Channels?

Because a Channel post is a message whose recipient is the Channel id, exactly as a group message is a message to a group id. Every message endpoint works, so a text post, an image with a caption, a video or a document goes to the Channel through the same request shape as a message to a person, and this recipe uses the link endpoint only because a preview card performs best.

Can I post a video or an image instead of a link?

Yes: use the image or video endpoint with the Channel id as the recipient and either a public URL or a media id for the file, and put the whole post in the caption, since the caption is the post. Upload once and reuse the media id when the same asset goes to several Channels, rather than uploading it again in every run.

Does the Activepieces WhatsApp piece do this?

No. That piece is built on Meta's official Cloud API, which has no notion of Channels at all, so it cannot list them or post to them. The generic HTTP piece against Wapito is the route to Channels from Activepieces, and because Activepieces can be self-hosted, the whole flow, the token and the post history can stay on your own infrastructure.

Related

Try it on your own number

Create a channel, link a WhatsApp number by QR or pairing code, and call the API in a couple of minutes. The Sandbox plan is free and needs no card.