# WhatsApp API with n8n: a workflow that receives and replies

To connect the WhatsApp API to n8n, no dedicated node is needed: a Webhook node receives each message from Nodium, and an HTTP Request node replies through the REST API. Add a signature check between the two, so the workflow only runs on events Nodium really sent.

## The workflow

- **Webhook node** — method `POST`, with the **Raw Body** option on: the signature is computed on the body exactly as received. Copy its production URL.
- **Signature check** — the `X-Nodium-Signature` header is `t=<timestamp>,v1=<signature>`. With the Crypto node, compute the HMAC-SHA256 of `<timestamp>.<raw body>` with your webhook secret, in hex, and compare it to `v1` in an If node. Stop the workflow when they differ.
- **HTTP Request node** — method `POST`, URL `https://nodium.io/api/v1/messages`, a `Bearer` credential holding your API key, and the JSON body below.

```json
{
  "channelId": "{{ $json.body.data.channel_id }}",
  "to": "{{ $json.body.data.from }}",
  "type": "text",
  "text": "You wrote: {{ $json.body.data.text }}",
  "idempotencyKey": "reply-{{ $json.body.id }}"
}
```

## Tell Nodium where to call you

Register the Webhook node's production URL, in the console under **Settings › Webhooks** or with the call below. The secret is shown once: store it in an n8n credential.

```bash
curl https://nodium.io/api/v1/webhooks \
  -H "Authorization: Bearer $NODIUM_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://your-app.example.com/webhooks/nodium", "events": ["message.received"] }'
# → data.secret (whsec_…): shown once
```

## Next

- The reply above is free text: it only goes out within the [24-hour window](https://nodium.io/en/guides/24-hour-window). To write first, send a [template](https://nodium.io/en/features/templates-broadcasts) with `"type": "template"`.
- Keep the `idempotencyKey`: when n8n retries a node, the message is sent once.
- An AI agent in n8n can also operate WhatsApp through Nodium's MCP server.

## Frequently asked questions

### Is there an n8n node for Nodium?

No. The Webhook and HTTP Request nodes cover the whole API, which is plain REST.

### Can I skip the signature check?

The workflow would run for anyone who finds its URL. Checking the signature is what proves an event comes from Nodium.

Updated 2026-11-10 · https://nodium.io/en/guides/whatsapp-api-n8n
