AI actions: let your bot check your own system

Your bot looks up things like an order status for a signed in user and answers from the real result.

With AI actions your bot can look things up in your own system while it chats, like where an order is or what is left on an account, and answer from the real result instead of a general answer. AI actions are part of the paid plans (Pro and up), also during a free trial, and nothing is on until you add an action and turn it on.

Who can trigger an action

Only verified signed in users of your app: the chat must pass a correct signature for the user (see Verify signed in users in your app). Guests and unverified visitors never trigger a call. If they ask for something an action covers, the bot tells them it can only check that for signed in users and offers a person from your team.

Every call carries the verified user's id, so your system decides what that user may see:

  • the header X-Assistly-User
  • the field assistly_user (in the query for GET, in the JSON body for POST)

If your app signs the email instead of an id, that email is what we send.

Add an action

  1. Open Settings and find AI actions.
  2. Click Add an action and fill in the Name (like Check order status), When should the AI use it? in plain words (like "Check order status when a customer asks where their order is"), and the Address: GET or POST and your https:// address. Put a field in curly brackets to use it in the address.

Add up to 5 Input fields: details the bot asks the visitor for and fills in, each with a name, Text or Number, and a short description. Add Headers if your system needs a key or token, like Authorization. Header values are stored encrypted, shown masked, and never sent to the chat or any public page.

  1. Click Save action, then Test with sample values. You see the status, how long it took and the start of the answer.
  2. Turn it On.

You can add up to 10 actions.

A simple example

Name: Check order status. When to use it: "when a customer asks where their order is". Address:

GET https://api.yourshop.com/orders/{order_number}

Input field: order_number (Text, "The order number from the confirmation email").

When a signed in customer asks "Where is my order 1042?", we call:

GET https://api.yourshop.com/orders/1042?assistly_user=user_8841
X-Assistly-User: user_8841

Your system checks that order 1042 belongs to user_8841 and answers, for example:

{ "status": "shipped", "carrier": "UPS", "eta": "Thursday" }

The bot replies: "Your order 1042 has shipped with UPS and should arrive on Thursday."

What the bot does with the answer

  • It answers only from what your system sent back. It never guesses or makes up a result.
  • If the call fails, takes too long or comes back empty, the bot says it could not check that right now and offers a person from your team.
  • It asks for a missing detail first, like the order number, before it calls.

Safety limits

  • Secure https:// addresses only. Addresses on private or internal networks are refused, also after a redirect, and at most 2 redirects are followed. A redirect to another address never gets your headers.
  • 5 seconds per call and up to 50 KB of answer.
  • At most 3 calls for one visitor message, 30 per conversation and 60 a minute for your account.

Call log

Every call is logged with the action, the time, the conversation, the status, how long it took and whether it worked. The last 50 show under AI actions, and each call from a chat is a note in that conversation for your team. Header values are never logged.

Still stuck?

Ask our assistant: it knows every article here, and our team reads every chat.