By Avi
Published on Nov 20, 2026
WhatsApp Chatbot API Node: How to Call Your Backend, CRM or AI Engine Mid-Conversation
A chatbot that only sends fixed messages hits a wall fast. The API node lets your WhatsApp bot call your backend, CRM, payment gateway or AI engine mid-conversation, store the response, and branch on success or failure. Learn setup, testing, use cases and best practices.
TL;DR
- The API node lets your WhatsApp chatbot call an external system (your backend, CRM, payment gateway, AI engine) while the customer is still chatting.
- The bot sends a request, waits for the response, then decides what to do next.
- In Chakra Chat you configure the API, store the response in a variable, pick the value with a JSON path, and route 2xx responses to success and non-2xx to failure.
- Use it when a reply needs live data, not a fixed message.
- You write a small endpoint. Chakra handles the WhatsApp side.
A customer messages your WhatsApp number: "Where is my order?"
A basic chatbot can only say, "Please share your order ID and our team will get back to you." Then a human logs into a dashboard, finds the order and types a reply.
That works at 20 chats a day. It breaks at 2,000.
The fix is not a smarter script. It is letting the bot ask your own systems for the answer. That is what the API node is for.
What is an API node in a chatbot?
A chatbot flow is a series of steps (nodes): send a message, ask a question, assign to a human, and so on. The API node is the step that talks to the outside world.
In Chakra's words, the node lets your chatbot call an API from the chatbot itself, and the response can be used later in the flow.
Think of it as a phone call your bot makes mid-conversation:
- Who it calls: your backend, a CRM, a payment gateway, an AI engine or any third-party service with an API
- What it asks: "What is the status of order 4821?" or "Is coupon DIWALI20 valid?"
- What it does with the answer: shows it to the customer, stores it, or picks the next step
Use it whenever a step needs live, external data instead of a fixed message.
How does it work?
The idea is simple: request, response, decision.
- The customer replies. The bot collects what it needs, for example an order ID, through a Question node.
- The API node fires. It sends a request to your URL with the collected data.
- Your system answers. It returns data (order status, coupon result, AI reply) and a status code.
- The bot decides. A 2xx response takes the success path. Any other response takes the failure path.
- The customer sees the result. A Message node shows the stored value, or the flow moves on.
Customer message
|
Question node (collect order ID)
|
API node ---> Your backend / CRM / AI engine
| |
|<------ response ---+
|
2xx? ---- yes ---> Message: "Your order is {{status}}"
|
no ----------> Fallback: "Let me connect you to our team"
The conversation never leaves WhatsApp. The customer just sees a fast, specific answer.
What can you use it for?
Anywhere a reply depends on data that lives somewhere else.
| Use case | What the bot calls | What the customer gets |
|---|---|---|
| Order status | Your order system | "Your order is out for delivery, arriving today" |
| Coupon check | Your promo engine | "Code valid. You get 20% off" |
| Customer lookup | Your CRM | A personalised greeting and account details |
| Payment status | Payment gateway | "Payment received, thank you" |
| Appointment booking | Your calendar or booking system | Available slots, then a confirmation |
| Lead capture | CRM or Google Sheets | A new lead created from the chat |
| AI answers | Your AI engine or RAG service | A grounded answer to a free-text question |
| KYC or eligibility | Internal or third-party service | "You are eligible, here is the next step" |
Examples by industry
- D2C and e-commerce: order tracking, returns, stock checks
- Education: fee status, batch timings, result lookup
- Real estate: pull project and unit availability from your CRM
- Healthcare and clinics: check appointment slots and confirm bookings
- Logistics: shipment tracking by AWB number
- Finance and insurance: policy status, premium due dates
Calling your own AI engine
If you have built your own AI layer (a RAG pipeline, a fine-tuned model, a support copilot), the API node is the bridge.
The flow:
- Ask the customer a question with a Question node
- Send the text to your AI endpoint through the API node
- Store the answer in a variable
- Show it in a Message node
- If the call fails, route to a human
A few tips:
- Return a short, clean answer field. Long outputs are hard to read on WhatsApp.
- Keep response time low. The customer is watching a chat window.
- Always have a fallback path, because AI endpoints can time out or error.
Chakra also has a built-in AI Node and conversational AI features. Use those when you want AI without writing code. Use the API node when you want to bring your own engine, data or business logic.
Setting it up in Chakra Chat
Here is the flow from Chakra's Call API node guide, explained in plain steps.
1. Configure the API to call
- Drag the Call API node onto the canvas, to the right of the node that collects the input
- Click Show Editor to open the API configuration
- Enter your URL and choose the HTTP method
- Choose a body type: form url encoded or form multipart
- Add your key/value pairs, for example
order_idmapped to the customer's answer - Click Save API
2. Pass chat data into the request
Type {{ in the payload to see the variables you can insert. You can use the last chat message text and anything collected earlier in the chatbot.
This is how a customer's order ID or email ends up inside your request.
3. Store the API response as a variable
Under Store response in variable?, enter a name such as api_response.
4. Pick the exact value with a JSON path
Under JSON path of value to store?, enter the path to the value you want. The response is read through the key response.data.
Example response from your server:
{
"order": {
"id": "4821",
"status": "Out for delivery",
"eta": "Today, 6 PM"
}
}
To store only the status, use:
response.data.order.status
Use the path to pull out just the value you need, so your messages stay clean instead of showing a whole response.
5. Branch on success and failure
The node has two outputs:
- Success: a 2xx response
- Failure: a non-2xx response
Connect each to the next node you want.
6. Use the variable in your reply
Add a Message node after the success output. Type @ and pick your variable, for example:
Good news! Your order status is: @order_status.
Save the node, then save the chatbot.
A tiny example endpoint
Your side only needs to return JSON. Here is a minimal Node.js example (yours will differ):
app.use(express.urlencoded({ extended: true }));
app.post("/order-status", async (req, res) => {
const order = await db.findOrder(req.body.order_id);
if (!order) {
return res.status(404).json({ error: "Order not found" });
}
res.json({
order: { id: order.id, status: order.status, eta: order.eta }
});
});
A 404 goes down the failure branch, so your bot can say "I could not find that order" instead of showing nothing.
Testing before you go live
Test in layers.
- Test your endpoint on its own. Use a tool like cURL or Postman first. Confirm it returns the status codes and JSON you expect.
- Test the flow in the builder's preview mode. Chakra's chatbot builder lets you simulate a WhatsApp conversation before it goes live.
- Test the unhappy paths. Wrong order ID, empty reply, your server being down.
- Check the JSON path. If the message shows blank, the path usually does not match the response.
- Test on a real phone with a test number before you switch it on for customers.
What happens after the response?
Think of the response as a fork in the road.
On success (2xx):
- Show the answer in a Message node
- Use the stored value later in the flow
- Move to the next question or close the chat politely
On failure (non-2xx):
- Send a friendly fallback message
- Offer a retry
- Pass the chat to a human with the Assign to Human node
Handling failures well
Your API will fail sometimes. Plan for it.
- Never leave the customer hanging. Every API node should have a failure path.
- Use specific messages. "We could not find that order. Please check the ID" beats "Something went wrong."
- Offer a human. Failures are exactly when a person adds value.
- Return meaningful status codes. A 404 for "not found" and a 500 for "server problem" lets you handle each case on purpose.
- Keep the call fast. The chat waits for the answer, so slow endpoints feel like slow replies.
- Do not use it for long jobs. For anything that takes minutes, start the job and send the result later as a separate message.
Key advantages
- Live answers instead of canned replies. Customers get real data in the chat.
- Fewer tickets for your team. Repetitive questions are handled end to end.
- Works with systems you already have. No need to move your data into the chatbot.
- Bring your own logic. Business rules, pricing, eligibility and AI stay in your code.
- Low-code flow, code only where needed. Operations teams manage the conversation. Developers own the endpoint.
- Reusable. One endpoint can serve many flows.
Why not build everything on your own system?
You can. Some teams do. Here is what that involves:
| Task | Build it yourself | Use Chakra with the API node |
|---|---|---|
| Connect to WhatsApp Business Platform | You build and maintain it | Done for you |
| Receive and route webhooks | You build it | Handled in the platform |
| Conversation state and flow logic | You code and store it | Visual flow builder |
| Template management | You build it | Native template management |
| Team inbox and human handoff | You build it | Built in |
| Business logic and data | Your code | Your code, called through the API node |
| Change a flow | Code change and deploy | Edit in the builder |
The real choice is not "build vs buy." It is what you want your developers to spend time on.
- Spend it on your business logic: order lookups, pricing, eligibility, AI
- Not on plumbing: WhatsApp connections, webhooks, inbox and flow tools
When does building your own make sense? If your bot logic is extremely custom, or you must run everything in your own infrastructure. For most teams, a hybrid is faster: the platform runs the conversation, your system supplies the answers.
Best practices
- Protect your endpoint. Use HTTPS and an authentication method. Never leave a data endpoint open.
- Return small, flat JSON. It is easier to map and less likely to break.
- Keep field names stable. Changing a response shape can silently break your JSON path.
- Use clear variable names such as
order_status, notdata1. - Validate input first. Check the order ID format in the flow before you call your server.
- Always build the failure path.
- Respect privacy. Return only what the customer should see, and verify identity before showing account details.
- Log requests on your side so you can debug problems.
Limitations to know
- The chat waits for the response, so slow endpoints hurt the experience.
- You need a developer to build and secure the endpoint.
- Mistakes in the JSON path will show up as blank values.
- Check which plan includes the Chatbot API node on the pricing page. Developer API and webhook access is included on paid plans from Starter.
Why teams use this on Chakra Chat
Chakra serves 2,500+ customers in 65+ countries, and the chatbot builder is made to be simple for business teams and flexible for developers.
- Visual builder with preview mode to test flows before going live
- Coexistence support so you can keep your WhatsApp Business app number. See how it works
- No markup on template messages
- Setup help and ongoing support
- Mobile apps for iOS and Android
- Developer APIs at apidocs.chakrahq.com for deeper integrations
Want to see the builder? Explore the WhatsApp chatbot builder.
FAQs
What is an API node in a WhatsApp chatbot? It is a step in your flow that sends a request to an external system and uses the response in the conversation.
Can the API node call my own AI engine? Yes. Send the customer's message to your AI endpoint, store the answer in a variable and show it in a Message node.
What decides success or failure? The HTTP status code. A 2xx response goes down the success branch. Anything else goes down the failure branch.
How do I pick one value from a long response? Use the JSON path field. The response is read through response.data, so a status field might be response.data.order.status.
Can I pass customer details to my API? Yes. Type {{ in the payload to insert the last chat message or any variable collected earlier.
What if my server is down? The flow follows the failure branch. Use it to send a polite fallback and hand over to a human.
Do I need to code? You do not code the chatbot flow. You do need a developer to build the endpoint the node calls.
Which plan do I need? Developer API and webhook access is on paid plans from Starter. Check the pricing page for the plan that includes the Chatbot API node.
Wrapping up
A chatbot that only sends fixed messages is a menu. A chatbot that can ask your systems for the truth is an assistant.
The API node is the small step that makes the difference: collect the input, call your system, store the answer, branch on success or failure. Start with one simple use case, like order status or coupon check, and build from there.
References
- Chakra Help: Use the Call API node in chatbot
- Chakra Chat: WhatsApp chatbot builder
- Chakra Chat: Developer APIs
- Chakra API docs
- Chakra Chat pricing