Search and browse help

Custom actions — connect your own API

Let your chatbot look up orders, start returns or read account details by calling your HTTPS API during the conversation. Growth plan.

A custom action lets your chatbot do something during a conversation by calling your own API: check where an order is, open a return request, read a customer's plan, create a helpdesk ticket. You don't install an app — you point the bot at an HTTPS endpoint you (or your developer) already have. Available on Growth and higher.

Create an action

  1. Open the Actions tab

    Open your chatbot and go to the Actions tab, then click New action.

  2. Name and describe it

    Give it a short name such as lookup_order and a description that says when to use it and what it returns, for example: Look up the status of one of the customer's orders: status, carrier, tracking link and estimated delivery. The description is what makes the bot call it at the right moment.

  3. Add the inputs

    List what the bot must ask the customer for, such as order_number. Mark the ones it cannot do without as required.

  4. Set the request

    Choose the method and enter the URL, e.g. https://api.yourstore.com/orders/{{order_number}}. Add headers your API needs, such as Authorization: Bearer .... For POST, PUT or PATCH you can write a JSON body template; without one we send the inputs, the verified customer and the conversation.

  5. Choose the safety settings

    Turn on Only for verified customers for anything about one customer's data, and Ask the customer to confirm first for anything that changes something.

  6. Send a test request

    Save, then use Send test request with sample inputs and, if needed, a sample customer. Check the status and the response, then try a real question in the Sandbox tab.

Variables

The URL, headers and body can use variables in double braces:

Variable Value
{{order_number}} Any input you defined
{{user.id}} The verified customer's id (from your identity token)
{{user.email}}, {{user.name}}, {{user.phone}} The verified customer's details, when your token includes them
{{user.attributes.plan}} Any key of the token's attributes
{{conversation.id}}, {{conversation.channel}} The current conversation

Variables in the URL are URL-encoded. In a JSON body, put them inside strings ("{{order_number}}"); a string that is exactly one variable keeps its type (a number stays a number). Variables can't be used in the host name.

Safety settings

  • Only for verified customers — anonymous visitors are asked to sign in and nothing is sent. On WhatsApp and Telegram the customer is identified by their account, so this works there automatically.
  • Ask the customer to confirm first — the bot summarizes what it will do and asks; ChatbotGen only sends the request when the customer replies Yes, confirm (or Sí, confirmar) and the bot calls the action again with exactly the same details. This is enforced by ChatbotGen, not left to the AI. The widget shows Yes, confirm / No, cancel buttons.

What the bot sees

The bot receives up to 8,000 characters of your response, as data. Return only the fields it should use, and leave out anything it must not tell the customer. A response that is not 2xx is reported to the bot as a failure, so it won't pretend the action worked. Requests time out after 10 seconds.

Activity log

Every call is listed under Activity on the Actions tab: when it ran, the inputs, the status and the response (stored encrypted). Use it to see why an action failed — a wrong URL, a missing header, or a guest using a verified-only action.

Examples

  • Order status — GET https://api.yourstore.com/orders/{{order_number}}?email={{user.email}}, verified customers only.
  • Return request — POST https://api.yourstore.com/returns with inputs order_number and reason, verified customers only and confirmation on.
  • Helpdesk ticket — POST to your helpdesk's ticket API (Zendesk, Freshdesk…) with its API token in the Authorization header, confirmation on.

See also