Skip to main content

Webhooks

WhatsApp End of Session

Sends an HTTP notification to your endpoint when a WhatsApp conversation with one of your agents closes: after the idle wait without messages, a few minutes after the agent ends the chat, or when a template you sent gets no reply. See WhatsApp conversations for when each one happens.

Configuration​

This event uses the agent's end-of-call webhook field, the same address that receives End of Call for calls (Instructions tab, For developer section; see General). For an agent that answers WhatsApp, every conversation that closes is sent there, including the ones that close with no reply from the contact.

Delivery​

  • Method: POST
  • Content-Type: application/json
  • Authorization: none. The request has no Authorization header.
  • Retries: none. The request is sent once.

Payload​

startedAtstring
Date and time of the first message of the session, in ISO 8601.
messagesarray
The messages of the session, oldest first (at most the latest 200).
analysis.summarystring
Summary of the conversation. Empty when the contact never wrote.
analysis.structuredDataobject
Output variables the agent captured. Empty when the contact never wrote.
analysis.successEvaluationboolean
Optional. Whether the conversation met the agent's success criteria. Present only when the agent has success criteria; false when the contact never wrote.

Message details​

Each item in messages has:

  • role: user for the contact, assistant for the agent (including the templates you sent)
  • message: the text of the message

Responding to events​

Return any HTTP 2xx status code to acknowledge receipt. Response body is ignored.

Any other response, or a network error, counts as a failed delivery. The event is not sent again, and the session card in the dashboard's Messages inbox shows Webhook failed.