Skip to main content

Actions

An action is an HTTP call to your own API that the assistant can make during a chat: look up an order, create a support ticket, reschedule a delivery. You describe the call once; the assistant decides when it fits and fills in the values.

Two kinds​

KindWhat it may doConfirmation
QueryReads something: order status, a balance, stock.Runs at once. The result goes into the reply.
ChangeCreates or changes something: a ticket, a booking, an address.The assistant asks the visitor first ("I can raise a complaint about the Pune pallet. Shall I go ahead?") and runs only on a yes. Mark an action irreversible to require your team's approval instead.

Describing an action​

Actions → New action.

FieldExample
Name and description"Create ticket: opens a support ticket in our helpdesk when a customer reports a delivery problem." The description is how the assistant knows when to use it.
Method and URLPOST https://helpdesk.acme.in/tickets
HeadersAuthorization: Bearer {{secret}} — the secret comes from your vault, never from the page.
Credentialvault:acme-helpdesk-key: a key stored in the vault (Integrations → API keys, or right there on the action).
Body or query template{ "title": "{summary}", "customer": "{user.user_id}", "priority": "{priority}" }
Parameterssummary (text, required, "what went wrong"), priority (one of normal/urgent). Each has a type, whether it's required, and how to ask for it.
Result fieldsWhich parts of the response the assistant may use in its reply (ticket.id → "Ticket number"). Everything else is dropped.

Placeholders: {param} for a value the visitor gives (typed and checked against the parameter's type), {user.user_id}, {user.email}, {user.plan}, {user.attrs.<name>} from the signed-in token. Signed-in values never come from what the visitor typed, so a visitor can't act on someone else's account.

Test calls the action for real, once, with values you type, and shows the request and the response. An action only goes live after that.

In the chat​

  • The assistant asks for any missing values one at a time ("What went wrong?").
  • For a change: a yes/no with buttons; typing "yes" works too. A "no" cancels it and the assistant offers a person.
  • The reply uses only the result fields you allowed.
  • Every run is in Actions → Runs with the request, the response code, and the visitor's values (sensitive ones masked), and raises action.executed, action.failed or action.declined events.

Good practice​

  • Keep each action to one job. "Order status" and "Cancel order" are two actions, one a query and one a change.
  • Make your endpoint idempotent for changes: if a retry reaches you twice, it should not create two tickets.
  • Mark values like a card number as sensitive so they are masked in logs.
  • Use a signed-in action for anything on a customer's account: the assistant can only act for the person your server identified.