Chatbot flows · v1

Chatbot flows: API request step

The WhatsApp chatbot flow builder has an API request step. It calls your own HTTPS endpoint during a conversation. Use it to send a lead to your CRM, or to look something up and reply with the result.

Where to find it

In the dashboard, open WhatsApp → Flows, edit a flow, and add an API request step.

Step fields

FieldWhat it does
MethodGET or POST.
URLYour endpoint. HTTPS only.
HeadersUp to 10.
JSON bodyPOST only. Up to 4096 characters.
Save the response asA variable name for the reply, used later as a placeholder.
Only the value at pathOptional. A dot path into the JSON reply, for example data.status or items.0.id.

Placeholders

Write placeholders as {{name}} in the URL, header values and body. They are filled in when the step runs.

PlaceholderValue
{{name}}The customer’s WhatsApp profile name; there if they have none. Filled automatically.
{{phone}}The customer’s WhatsApp number: digits with country code, no + (for example 919876543210). Filled automatically.
{{_lastReply}}The customer’s most recent message. Filled automatically.
{{your_name}}The answer to an Ask step whose Save answer as is your_name. For an Ask step that expects a photo or file, it is the WhatsApp media ID, not a link.
{{attribute}}The value written by a Set attribute action of that name.
{{result}}The reply saved by an earlier API request step whose Save the response as is result.
  • Names use letters, digits and _ only. {{first-name}} or {{lead.city}} are not filled.
  • An unknown or never-set placeholder becomes an empty string. There is no error.

Example: send a lead to your CRM

A POST step. city and requirement come from two Ask steps earlier in the flow.

JSON body
{
  "name": "{{name}}",
  "phone": "{{phone}}",
  "city": "{{city}}",
  "requirement": "{{requirement}}",
  "last_message": "{{_lastReply}}",
  "source": "whatsapp_chatbot"
}

Example: look up an order

A GET step that saves one field from the reply, then a Send step that uses it.

Step setup
Method                 GET
URL                    https://api.yourshop.com/orders/{{order_no}}
Save the response as   order
Only the value at path data.status

Next step (Send):
  Your order is {{order}}.

How the request is sent

  • The URL must be HTTPS and must resolve to a public address. Private and internal IPs are refused. Redirects are not followed.
  • POST sends Content-Type: application/json unless you set your own Content-Type header.
  • Header values can use placeholders. For a fixed key, set Authorization: Bearer <key>.
  • The step waits up to 5 seconds for a reply.

What gets saved

  • The saved reply is capped at 4096 characters.
  • With a path, a text or number value is saved as-is. An object or array is saved as JSON text.

When the request fails

Any non-2xx status, a timeout or an error counts as a failure. The flow continues and the saved value is empty. Write the next message so it still makes sense when the value is blank.

Placeholder values are not JSON-escaped

Values are inserted as typed. A free-text answer with a double quote or a line break (for example My flat is "B-204") makes the body invalid JSON. Inside JSON strings, prefer placeholders with predictable values: phone, name, option answers. Or make your endpoint tolerant of bad JSON.

What your endpoint should do

  • Answer fast, well inside 5 seconds.
  • Return a 2xx status.
  • Respond with JSON if you want to save a field from the reply.
Chat with us