Agent scripts: guided branching reply flows for digital conversations
An agent script is a small, guided decision tree your agents walk during a live digital conversation. Each script is a graph of steps — a prompt the agent reads, a question to ask the customer, an internal note, or a final disposition — and each step can carry branch options that route the agent to the next step based on the customer’s answer. The console follows whichever branch matches; the agent never has to remember the flow. Scripts are the digital counterpart to the voice queue-script console: static macros give agents prewritten replies, and AI suggestions draft replies, but a script is the tool for a process — a billing dispute, a cancellation, an eligibility check, a KYC intake — where the right next question depends on the customer’s answer. Base path:/api/v1/inbox
Dashboard surface: Settings → Conversations → Agent Scripts (owners and admins; the write API is owner/admin-only, reads are open to any teammate so the agent console can fetch the graph).
Where scripts fire
Agent scripts apply to the digital channels the inbox serves: web chat, email, WhatsApp, SMS, RCS, Viber, Instagram, Messenger, LINE, Telegram, Apple Messages, WeChat, KakaoTalk, and Zalo. A script can target a subset of those channels, or every channel when the channel list is left empty. Scripts do not apply to voice. Voice queues have their own scripting surface (queue scripts on a voice queue’s Scripts tab), which walks an agent through a decision tree during a live call instead of a messaging thread. A script is guidance only: it never sends anything to the customer by itself. The agent reads the step, sends or paraphrases it, and picks the branch that matches the customer’s answer.Building a script in the dashboard
Open Settings → Conversations → Agent Scripts and click New script. The editor works top to bottom:- Name and description. The name is what agents see in the console picker; the description reminds supervisors what the flow is for.
- Channels. Toggle the digital channels the script applies to. Leave all untoggled to surface it on any channel.
- Active. Only active scripts surface in the agent console — keep a draft inactive while you build it (see Roll out a script).
- Steps. Add steps in the order you first imagine them; each step has a kind, an optional title, and a body — what the agent reads, asks, or does:
prompt— a message the agent reads or sends verbatim (a greeting, a policy statement).question— the decision node: ask the customer, then pick the branch that matches their answer.note— internal-only guidance shown to the agent, never meant for the customer.disposition— a terminal outcome the agent records when the flow ends (resolved, handed off, tagged).
- Branches. On any step, add branch options: a label (the customer’s likely answer) and the next step it leads to. Leave the next step on End flow to terminate cleanly.
- Start step. Pick the first step explicitly, or leave it on Auto to start at the first step in the list.
disposition step instructs the agent to resolve the conversation, hand it off to a queue or teammate, or tag and park it. Give the step a clear title like “Resolve — refund issued” so the end of every branch is obvious in the console.
Save the script. Each save — create or edit — bumps the script’s version counter, and every create, update, and delete lands in your audit log with the acting user.
The schema the API accepts
The REST shape is the same one the dashboard posts: an object withname, and optionally description, channels, enabled, start_step_id, and steps. All writes require an owner or admin API key; reads only need an authenticated key.
Each step object:
Each option object:
Graph rules — enforced on every create and update before anything is saved:
- Every
step_idmust be unique (a duplicate makes a branch reference ambiguous). - Every option
next_step_id(when set) must resolve to a step in the same script. start_step_id(when set) must resolve to a step in the script.
422 INVALID_SCRIPT_GRAPH with the reason (for example, "option on step \"s-check\" points at unknown step \"s-verify\"). Nothing is persisted on a failing graph. Other endpoints in the surface:
A PATCH with no fields at all returns
422; hitting the per-tenant limit of 200 scripts returns 409 LIMIT_EXCEEDED.
Only two roles can write: owner and admin. Agents can always read the scripts so the console can walk them.
Roll out a script: draft to live
- Draft it inactive. Create the script with
enabled: false(or the Active switch off in the dashboard). An inactive script is saved, versioned, and invisible to the agent console. - Dry-run it before enabling. Walk the tree yourself: trace every path from the start step to a terminal
dispositionstep and confirm no branch lands on a dead end, no step title reads ambiguously in the branch picker, and every flow ends with an explicit resolve/handoff/tag instruction instead of an abrupt stop. Have a supervisor run through a real conversation with the script left inactive to review the wording. - Publish. Set
enabled: true— via PATCH or the Active switch — and the script immediately surfaces in the agent console for the channels it targets. - Version on every change. Every PATCH bumps
version, so the console can tell an agent mid-flow that the script was refreshed under them and reload. Use the returnedversionon the PATCH 200 response to confirm the publish landed.
What the agent sees in the console
During a live conversation on a channel the script targets, the agent opens the script from the console’s script picker (onlyenabled scripts appear). The console renders one step at a time:
- The current step. Its kind badge (prompt / question / note / disposition), title, and body text — exactly what to read or do.
- Detected answers. On a
questionstep, the branch options you authored render as pickable choices. The agent clicks the one matching the customer’s answer and the console advances to that step. - The transcript dump. The console keeps the path the agent walked, so a supervisor reviewing the thread sees which branches were taken, not just the messages that went out.
disposition step the agent records the terminal outcome — resolve, handoff, tag — which closes out the flow deliberately instead of leaving the conversation hanging.
Two worked examples
Example 1 — “My order is late” troubleshooting
Rendered tree:Example 2 — KYC intake
Rendered tree:disposition step that names the target queue — the agent executes the handoff in the console, the script tells them where it goes.
Troubleshooting
Every capability on this page is a tenant-owned control: scripts, steps, channels, and rollout live entirely inside your workspace, and the audit log records who created, changed, or deleted each script. Nothing in a script contacts the customer on its own — the agent stays in the loop on every step.