Connect Any REST API
Send GET or POST requests to any endpoint that returns JSON. Your CRM, order system, billing platform, or custom backend — if it has an API, you can query it.
The API Conditional module queries an external API in real time — your CRM, order management system, or any REST endpoint — and branches the workflow based on the response. Check order status, verify accounts, look up subscription tiers, and route the conversation dynamically, all within the chat.
The API Conditional module makes an HTTP request to an external API endpoint during the chat conversation, evaluates the response, and branches the workflow based on what comes back. It's the bridge between your chat widget and the rest of your business systems — your CRM, order management platform, subscription billing service, inventory database, or any system that exposes a REST API.
Consider a common scenario: a visitor asks "Where is my order?" Without the API Conditional, an agent would need to manually look up the order number in a separate system, copy the status, and paste it into the chat. With this module, the workflow collects the order number, fires an API request to your fulfilment system, reads the response (e.g., "status": "shipped"), and displays the answer to the visitor — all in under a second, with no human involvement.
The module supports GET and POST requests with custom headers, authentication tokens, and request bodies. You can map variables captured earlier in the workflow (like an order number or email address) into the API request as query parameters or body fields. The response is then evaluated against conditions you define — status code checks, JSON field comparisons, or simple existence tests — and the workflow branches accordingly. If the API returns a match, one path fires. If it doesn't, another path handles the fallback. You can even extract specific values from the API response and store them as workflow variables for use in subsequent Message nodes.
Send GET or POST requests to any endpoint that returns JSON. Your CRM, order system, billing platform, or custom backend — if it has an API, you can query it.
Pass visitor-collected data (order number, email, account ID) into the API request automatically. No manual input, no agent required.
Evaluate the API response with conditions: check a JSON field value, HTTP status code, or whether a record exists. Each outcome maps to a workflow branch.
Extract values from the API response — order status, account name, subscription tier — and save them as workflow variables for use in later messages.
The API Conditional is typically placed after a data-collection step. You need input from the visitor — an order number, email address, account ID, or postcode — before you can query the API. The Collect Info module gathers that data, passes it to the API Conditional as a variable, and the API request fires immediately.
After the API responds, the workflow branches. A "found" branch might display the order status, account balance, or appointment details directly in the chat. A "not found" branch might ask the visitor to re-enter the data or offer to connect them to a live agent for manual lookup. An "error" branch can handle timeouts or API failures gracefully, ensuring the visitor never sees a broken experience.
An online retailer lets visitors check their order status directly in the chat widget, with no agent involvement.
{{order_number}}.https://api.store.com/orders/{{order_number}}. The request includes an API key in the header for authentication.API integrations within chat workflows are incredibly powerful but require careful setup. Follow these guidelines to ensure reliability and security.
Never expose API keys in client-side code. The API Conditional sends requests server-side, keeping credentials safe. Use environment variables or the built-in secrets manager.
APIs fail. Always define an error/timeout branch that gives visitors a useful fallback — a message explaining the issue and a path to a live agent who can help manually.
Configure a timeout (e.g., 5 seconds) so visitors aren't left waiting if the external API is slow. If the timeout triggers, route to the error branch immediately.
Before going live, test your API Conditional with actual order numbers, account IDs, and edge cases (invalid input, expired records). Verify every branch works as expected.
The API Conditional supports GET and POST requests with custom headers, query parameters, and JSON request bodies. You can include authentication tokens, API keys, and any headers your endpoint requires.
Yes. Any variable captured by a Collect Info, Form Field, or other input module can be injected into the API request URL, query parameters, or body using the {{variable_name}} syntax. This is how you pass order numbers, email addresses, or account IDs to your API.
You can configure a timeout threshold and an error branch. If the API fails to respond within the timeout, or returns a server error, the workflow routes to the error branch — typically a message explaining the issue and a handoff to a live agent.
Yes. All API requests are made server-side over HTTPS, so visitor data never passes through the browser. API keys and authentication tokens are stored securely and are never exposed to the client. The module is designed to be safe for transmitting sensitive data like order numbers and email addresses.
The API Conditional works alongside data collection and routing modules to create powerful, system-integrated chat workflows.
Query APIs, display real-time data, and branch dynamically — all within your chat widget. No code, no middleware, just results.