Skip to main content
A WhatsApp agent can notify your server at each stage after a chat closes. You subscribe per agent, under Event Subscription in the agent editor. The mechanics are the same as call webhooks, but the events and payloads describe a chat, not a call.

Events a WhatsApp agent can send

They arrive in that order: chat_completed first, then the two analysis events as each finishes, then all_processing_completed. An analysis event is skipped when its analysis didn’t succeed, but all_processing_completed still fires and carries the status.
Call events (call_started, call_ringing, call_ongoing, call_completed, recording_completed) never fire for a chat, so they aren’t offered on a WhatsApp agent. Subscribing to one through the API returns 400: Event type ‘call_completed’ is not available for a WhatsApp agent — it can only be produced by a voice call. Likewise, chat_completed can’t be added to a voice agent.

Create a subscription

1

Open Event Subscription

In the agent editor, select Event Subscription under Advanced Settings.
2

Enter your endpoint

Choose the Method (POST by default) and enter the Callback URL, for example https://your-domain.com/webhook.
3

Select events

Tick the events you want. Only the four chat events above are listed for a WhatsApp agent.
4

Add headers (optional)

Use Add Header for anything your endpoint needs, such as an Authorization token.
5

Save

Select Create Subscription. Each event type can have up to four subscriptions.

Event Subscription on a WhatsApp agent offers only the chat events.

Payload

Every chat event shares the same base fields, and none of them carries call_id or call_sid. Use entity_type to tell chat events from call events on a shared endpoint.
platform_analysis_completed and client_analysis_completed carry the base fields and transcript, plus that analysis in analysis_data and its status.

Delivery and retries

  • Requests use the subscription’s method with Content-Type: application/json plus your custom headers. A GET subscription is sent without a body.
  • Your endpoint has 30 seconds to respond. Any 2xx counts as delivered.
  • 5xx responses and timeouts are retried with backoff. A 429 is retried more slowly. Other 4xx responses are not retried.
  • The same event can be delivered more than once, so make your handler idempotent on chat_id + event_type.
chat_completed fires when the chat closes, not after each message. If the customer simply stops replying, the chat can stay open for hours. See when a chat opens and closes.