Centro de ayuda Setting up automated chatbot triggers

Setting up automated chatbot triggers

Setting up automated chatbot triggers

Triggers are events or keywords that start an automated message chain in your Telegram, Viber, Instagram and Facebook Messenger chatbots.


1. Trigger types

  1. Keywords — fires when a message contains a given word or phrase (price, delivery, buy, help).
  2. Welcome trigger — fires on a user’s first interaction with the bot.
  3. Webhook / API trigger — fires from an external event in your CRM: an order status change, an abandoned cart, a payment.
  4. Scheduled trigger — fires a set time after a previous action, for example a reminder 24 hours later.

2. Creating a keyword trigger

  1. In SMSBAT Omni, open the bot builder and select the chatbot.
  2. Go to Triggers and click Add Trigger.
  3. Choose Keyword Match and the matching mode:
    • Exact Match — the message equals the phrase.
    • Contains — the message contains the word.
    • Regex — a regular expression for more complex rules.
  4. Enter the keywords, separated by commas.
  5. Attach the trigger to the chatbot block or funnel it should start.

Order matters

If several triggers can match the same message, the more specific one should come first. A broad Contains rule placed above an Exact Match will swallow it.


3. Firing a trigger over REST API

You can start a trigger scenario straight from your backend:

POST /api/triggers/execute
Host: restapi.smsbat.com
X-Authorization-Key: YOUR_API_KEY
Content-Type: application/json
{
  "triggerId": "trg_order_status_update",
  "recipient": {
    "phone": "380936670003",
    "channel": "viber"
  },
  "variables": {
    "customer_name": "Alex",
    "order_number": "10492",
    "status": "Delivered to the pickup point"
  }
}

The keys in variables are the placeholders used in the scenario’s message templates.


4. Trigger analytics

Reports are available per trigger:

  • how many times it fired over a period;
  • conversion from the trigger through to the target action;
  • where in the chain users drop off.