Smart Webhooks
Smart webhooks is a way to use generative AI to provide personal answers with data from external sources (CRM, PIM, CMS, OMS, databases, etc).
How it works
You create a normal webhook and add it to your preferred dialogue. The chatbot from Kindly will then know when to call the webhook.
Pull the data you need from your external source and add it to the response payload in {aiReply.data: {...}}.
Your chatbot will then take the original message from the user, together with the data you provided to generate a personal and tailored reply to the end user.
Getting started
- Create a new webhook, e.g using Firebase.
- Add your webhook endpoint to a dialogue in Kindly under "Dialogue Outputs -> Advanced options -> Webhook".
- When answering your webhook (i.e. the webhook response), make sure your payload looks something likes this:
// Your code to fetch data from your source, like a JSON containing info about a specific product
const dataAboutUserRequest = fetchDataFromSource();
response.json({
aiReply: {
data: dataAboutUserRequest // Your response data goes here
}
}Test it by sending a message to the chatbot with the topic you chose earlier. The reply that the chatbot gives back to you will be AI generated and answering your question as long as the payload you provided contains the necessary data to provide a proper answer.
Tips
- Make sure the data is well structured and keys and values in your payload are well defined and understandble.
- The data can be in any form, like just some text, JSON, XLM or anything serialized, but it must be intellegible.
- Try to not include irrelevant data, as too much data can result in loss of quality and understanding by the AI.
Examples
Checking an Order Status
Let's imagine a user asks about their recent order. The chatbot triggers a dialogue connected to a webhook that checks your order management system.
- User: "What's the status of my latest order?"
- The dialogue about "Status order" gets triggered and it POST to your webhook
- Inside your server, you fetch the order info and put them in the webhook response under aiReply.data
{
"aiReply": {
"data": {
"order_id": "A-12345-XYZ",
"status": "Shipped",
"carrier": "FedEx",
"tracking_number": "781220801234",
"estimated_delivery": "2025-07-29",
"items": [
{
"name": "Classic Blue T-Shirt",
"quantity": 1
},
{
"name": "Black Denim Jeans",
"quantity": 1
}
]
}
}
}- Kindly's AI takes the user's original question ("What's the status of my latest order?") and combines it with the structured data you provided. It doesn't just display the data—it generates a natural, helpful, and personalized response.
- Bot: "Great news! Your order #A-12345-XYZ has shipped via FedEx. It's currently scheduled for delivery on July 29, 2025. You can follow its journey with tracking number 781220801234."
As you can see, the bot intelligently synthesized the data into a conversational and complete answer, creating a much better user experience than just listing the raw information.