Skip to main content

Overview

When a session processes a message, whatabot sends a POST request to the callback URL configured on your API Key. This is how your system receives the bot’s responses — text messages, media, interactive menus, transfers, and session finalization.

Configuration

The webhook URL is set per API Key via the callbackUrl field. See Create API Key or Update API Key.
The callback URL must use HTTPS and cannot point to localhost, loopback addresses, or private IP ranges (10.x.x.x, 192.168.x.x, etc.).

Payload Structure

Every webhook is a POST request with the following JSON body:

Top-level Fields

The changes Array

The changes array tells your system what happened during this flow step. There are three possible change types: A single webhook can contain multiple change types — for example, when a node sends a message, transfers the conversation, and emits a kanban event in the same step.

Message Types

When field is "messages", the value.messages array contains one or more messages. Each message has a type that determines its structure. All messages may contain an optional tags field (string[]) with the tags configured on the flow node that produced the message. Use tags to categorize or route messages in your system.

Text

A plain text message.

Media

A file attachment (image, video, audio, document, or sticker).

Template

A pre-approved WhatsApp message template.

Interactive — Button

A message with tappable buttons (up to 3).

Interactive — List

A scrollable list with sections and rows.

Interactive — CTA URL

A message with a link button.

Function Types

When field is "function", the value.functions array contains one or more actions triggered by the flow.

Transfer

The conversation was transferred to a human agent or sector.

Finish

The session was finalized.

Event Types

When field is "event", the value.events array contains domain events emitted during flow processing. Each event has domain, type, payload, and timestamp.

Kanban

Events emitted when the flow interacts with the kanban (Kanban Move node) or when operations are performed on cards linked to active sessions.

Complete Example

A typical webhook where the bot sends a greeting and presents buttons:
A webhook where the bot transfers the conversation:
A webhook with kanban events (card created and moved during the flow):

Delivery

Your endpoint must respond within 5 seconds. After that, the request is considered a failure and will be retried. Make sure your server processes requests quickly or use queues to handle the data asynchronously.
Your endpoint must respond with a 2xx status code. Non-2xx responses are treated as failures and will be retried up to 3 times.