Working with webhooks from bots
When creating or editing a bot, you can add a webhook by clicking the "+" to add an action as you normally would. From the action selection panel, click on "Trigger a webhook."
Next, give your action a nickname and input the endpoint URL for the webhook. If your webhook will be sending data to HubSpot in response to the request, check the "Wait for webhook feedback" box. (Read more on this below.) Save your action. When this action has been reached in a conversation, HubSpot will send a JSON payload to the Webhook URL you’ve defined. The payload will contain information relevant to the chat session, including the visitors' responses to any questions asked, their contact ID, and information about the bot.
Example request payload:
Advanced users also have the option of including JSON in your webhook's response. By doing this, you can impact the flow of conversation or send a custom message.
Example response payload:
Thank you for your feedback, it means a lot to us.