API via HTTP in n8n Cloud
Integrating Whapi.Cloud with n8n Cloud via HTTP Requests
This guide shows you how to integrate Whapi.Cloud with n8n Cloud using simple HTTP requests. You'll learn how to receive WhatsApp messages via webhooks, send text messages, create groups, and automate other WhatsApp actions directly from your n8n Cloud workflows.
To follow this guide, you'll need:
An active Whapi.Cloud account and your channel's API Token (available in your Whapi.Cloud dashboard). For more details on how to obtain a token, please refer to the article: Getting Started
An active n8n Cloud account with permission to create workflows.
Make sure both accounts are properly set up before proceeding.
Step 1. Setting up Webhook in n8n
In your n8n Cloud workflow, add a new Webhook node.

Configure the node by selecting POST as the HTTP method. Copy the generated Webhook URL provided by n8n.

Go to your Whapi.Cloud channel settings and paste the copied URL into the webhook URL field. Enable the events you wish to receive (e.g., incoming messages).


Your Whapi.Cloud events (new messages) will now trigger this Webhook node in n8n.
Step 2: Receiving Messages in n8n
Ensure your Webhook node in n8n is active and configured for POST requests. Before sending a test message, make sure the workflow is running — either in Test mode (click Listen for test event) or activated in Production mode.
Send a test message to your connected WhatsApp number.
The Webhook node in n8n will capture the incoming message instantly.
Inspect the received JSON payload to familiarize yourself with its structure for further workflow automation.

You can view all examples of incoming callbacks here: Incoming webhooks format
Example JSON payload:
Step 3: Sending Messages from n8n
Add an HTTP Request node to your n8n workflow.
To do this, select Core, then HTTP Request.

Configure the HTTP Request node as follows:
You will need to use the correct request configuration from the Whapi.Cloud documentation. Examples and convenient documentation with examples can be found here: API Docs
HTTP Method:
POSTURL:
https://gate.whapi.cloud/messages/text

Authentication:
To authorize, you will need to select Bearer Auth in the Credential Type field. After that, enter and save your channel token from Whapi.Cloud.

In the Body section, select RAW / JSON and enter:
Replace "recipient_number" with the recipient’s WhatsApp number (international format, no +).

You can specify either the recipient's number in international format or the chat ID. It doesn't matter which one you use. For more information about what a chat ID is, see: Chat ID. What is it and how to get it?
Filtering Incoming Messages to Build a WhatsApp Bot
So far, we've covered the basic setup of connecting the WhatsApp API to n8n, allowing you to receive incoming messages and send messages to any number — including groups and channels.
Now let’s look at a common use case: building an automated bot in WhatsApp. In this scenario, you typically want the bot to respond only to incoming messages, and ignore outgoing ones to avoid loops.
To achieve this, you’ll need to filter incoming webhooks. Let’s add a Filter node to your workflow.

Your goal is to distinguish incoming messages from outgoing ones. This can be done by checking the from_me parameter in the webhook payload:
from_me = true→ the message was sent by you (outgoing)from_me = false→ the message was received from the user (incoming)
By filtering for from_me = false, your bot will respond only to actual user messages and won’t react to its own replies.
Make sure to set the data type to Boolean when configuring the filter, as shown in the example below.

Creating a WhatsApp Group via n8n
Now let’s walk through how to create a new WhatsApp group and send a message to it - along the way, we’ll highlight a few important details.
To create a group, use the Create Group endpoint. You can find the full documentation here: 👉 https://whapi.readme.io/reference/creategroup
In n8n, add an HTTP Request node:
Set the method to POST
URL:
https://gate.whapi.cloud/groupsAdd your channel's Authorization Bearer Token to the headers
Now let’s review the required parameters:
subject: the name of the groupparticipants: an array of phone numbers (as strings) to be added to the group during creation
The easiest way to pass the participants array is by selecting “Specify Body → Using JSON” in the HTTP node. This allows you to enter the full JSON payload directly in the body. (There is also a more advanced method using a Set node to build the array dynamically, but we won’t cover that here.)

You can copy a ready-to-use JSON body directly from our documentation: https://whapi.readme.io/reference/creategroup. This helps avoid issues with extra line breaks or formatting.

After sending the request, the response will include full details of the newly created group.
Make sure to save the group_id, as you’ll need it later in the to parameter when sending messages to the group.

Also note the optional field unprocessed_participants. This indicates which numbers could not be added to the group.
To understand why this may happen and how to avoid it, see our guide: Why aren't participants being added to the group?
Simple example of AI bot in WhatsApp
JSON template

n8n WhatsApp Bot Template
We also provide a ready-to-use n8n WhatsApp bot template that demonstrates how to build a basic AI-powered bot using Whapi.Cloud.
The template is designed as a practical starting point for users who want to quickly deploy a working WhatsApp automation in n8n without building the flow from scratch. It includes a preconfigured workflow structure, message handling logic, and Whapi.Cloud API integration.
You can import the template directly into n8n and adapt it to your use case by extending the logic, adding buttons, enabling context retention, or connecting external systems.
The template is available on GitHub too: https://github.com/Whapi-Cloud/whatsapp-n8n-bot
This template is suitable both for quick demos and as a foundation for production-ready WhatsApp automations.
How to Check Why an n8n Request Sometimes Fails
If a node with the exact same parameters works sometimes and fails other times, checking the node's configuration won't help — you need to look at the data from the specific failed run.
1. Check the Executions tab
Open the Executions tab in the top menu of your workflow. Open the run in question, click on the node, and check its Input and Output panels.
If the run shows an error, open the error's full details instead of just reading the short message at the top — the expanded details often contain a more precise error description.
2. Use the Debug panel in the editor
Click on a node right after running it manually — its Input/Output data appears in the panel on the right or bottom of the editor.
As with Executions, if the node shows an error, open its details for a more precise error message.
3. Use a webhook.site trap
If you want to see exactly what n8n sends — headers, body, JSON structure — before it reaches the API:
Go to webhook.site and copy the unique URL it generates.
Temporarily replace the real API URL in your HTTP Request node with this test URL.
Run the node manually.
The request will appear on webhook.site in its raw form, showing exactly what n8n sent.
Remember to switch the URL back to the real API endpoint once you're done.


Need help getting started? We will tell you exactly how to create the scenario you need or help you find a mistake. Our support team is always here to assist you.
Last updated