Skip to content

Messages Webhook

Webhooks allow you to receive real-time notifications when events occur in your MAIA channels. When an AI agent responds to a message or a human operator sends a reply, MAIA will send an HTTP POST request to your configured webhook URL. Optionally, you can also receive incoming customer messages and echo messages (sent from the connected phone) via the same webhook.

How Webhooks Work

Webhook Events

Webhooks are triggered for:

EventDirectionDescription
AI ResponseoutgoingWhen an AI agent generates a response to a customer message
Human ReplyoutgoingWhen an operator manually sends a message through the channel
Incoming MessageincomingWhen a customer sends a message (requires Forward incoming messages toggle)
Echo MessageechoWhen the phone owner sends a message directly from their device (requires Forward incoming messages toggle, non-official WhatsApp channels only)

Test Sessions

Webhooks are not triggered for test sessions (sessions created via the test panel in the UI).

Configuring Webhooks

  1. Navigate to Channels in the MAIA dashboard
  2. Select the channel to configure
  3. In the channel settings, enter your Webhook URL
  4. Optionally, enable Forward incoming messages to webhook to also receive customer messages
  5. Save changes

A webhook secret will be automatically generated.

Incoming & Echo Messages

When Forward incoming messages is enabled, both incoming customer messages and echo messages (sent from the connected phone) are forwarded to the same webhook URL. Use the direction field in the payload to distinguish between "incoming", "outgoing", and "echo" messages. See Payload Reference for details.

Echo messages are only available for non-official WhatsApp channels. The official WhatsApp Business API does not relay messages sent from the phone.

Requirements

RequirementDetails
ProtocolHTTPS only (HTTP not allowed)
MethodMust accept POST requests
ResponseReturn 2xx status within 10 seconds
Content-TypeExpect application/json

Delivery Behavior

  • Timeout: 10 seconds per request
  • Retries: Up to 3 attempts with exponential backoff
  • Retry delays: 1s → 2s → 4s
  • Retried errors: 5xx responses, timeouts, network errors, 429 (rate limit)
  • Not retried: 4xx errors (except 429)

Error Handling

Webhook delivery failures don't affect message delivery. If your webhook is down, messages are still sent to the customer—you just won't receive the notification.


Next Steps

MAIA Platform Documentation