AI Agent — Map to Chat
Message Routing rules in Messaging Settings make a published AI Agent the answering party for messaging conversations that match a web page URL or SMS number.
A published AI Agent with the Messaging channel turned on answers only the conversations routed to it. Routing is set in Message Routing, part of the messaging configuration in Messaging Settings: each rule matches where a conversation comes from — part of the web page URL the chat widget sits on, or the number texted for SMS — and sends matching conversations to a destination. Selecting an AI Agent as a rule's destination makes it the answering party for those conversations.
Before MappingThe AI Agent must be published with the Messaging channel turned on. Calls reach an AI Agent through an IVR instead — see AI Voice Bot.
Accessing Message Routing
Message Routing is accessible to accounts with Admin permissions.
- Navigate to
Admin (System) > System Settings > Messaging - The
Messaging Configurationfield is listed with the current routing rule count alongside its edit icon
Mapping Messaging to an AI Agent
- Select the edit icon next to
Messaging Configurationto open the messaging editor - In the
Message routingsection, add a rule or edit an existing one, and complete the following fields:
| Field | Description |
|---|---|
Mapping Name | Names the rule, so it can be identified in the list |
URL/SMS Source Matching | Part of the web page URL where the chat widget is installed, or the DNIS number texted for SMS. A * before and/or after the value allows other characters to precede or follow it — for example, *support* |
Destination | Where matching conversations go — see Destination |
- Move the rule up or down so it sits in the right order — see Rule Order
- Select
Save
Once saved, the AI Agent answers every conversation that matches the rule. When a conversation needs a person, the AI Agent hands it off according to its own Transfers and escalation settings.
Destination
| Destination | Description |
|---|---|
| A skill | Conversations queue for agents in the selected skill |
| An AI Agent | The AI Agent answers the conversation. AI Agents are listed by name with an (AI) - prefix — for example, (AI) - Clinic Receptionist |
| A messaging flow | A Messaging Flow runs first and can hand the conversation to an AI Agent with its AI Messaging Bot action |
Skill Disabled | Conversations matching the rule are not routed |
AI Agents Missing From the Destination ListAI Agents built in the Agent Builder are listed as destinations in the web messaging editor starting with version 5.67. On earlier versions, set the AI Agent as the destination through
URL to Skill Mappingsin the Desktop Client instead — see Web Chat Configuration.
Rule Order
Rules are checked from the top down, and the first rule that matches wins. A more specific rule — such as one matching a single page — must sit above a broader one, or the broader rule answers first. Rules placed below a * rule can never be reached, and the editor marks them as unreachable.
Catch-All Rule
The last rule should be a catch-all: a rule whose URL/SMS Source Matching is exactly *, pointing to a real destination such as a skill or an AI Agent. Conversations that match no other rule follow it.
A Catch-All Rule Is Required for AI AgentsOn accounts using AI Agents built in the Agent Builder, the messaging editor does not save until the last rule is a
*catch-all whose destination is a skill or an existing AI Agent — notSkill Disabledor blank. Without it, the chat widget is not published and theChat Code Snippetstays empty.
Use CaseA clinic wants its AI Agent to answer chats on the booking page and everything else to go to its front desk team:
Booking Bot—*example.com/book*→(AI) - Clinic ReceptionistDefault—*→Front Deskskill
Installing the Chat Widget
After the routing is saved, the Chat Code Snippet in Messaging Settings holds the code that adds the chat widget to a web page. Copy it into every page the routing rules should cover. On accounts using AI Agents built in the Agent Builder, the snippet appears only after a routing configuration with a valid catch-all rule has been saved.
Troubleshooting
| Symptom | Resolution |
|---|---|
The AI Agent is not listed under Destination | Confirm the AI Agent is published with the Messaging channel on. On versions before 5.67, set the destination in the Desktop Client — see Destination |
| The messaging editor does not save | Add a * catch-all as the last rule, pointing to a skill or an existing AI Agent — see Catch-All Rule |
The Chat Code Snippet is empty | Save the messaging configuration with a valid catch-all rule to generate it |
| Chats reach a skill instead of the AI Agent | A rule above the AI Agent's rule matches first. Move the AI Agent's rule higher, or make the earlier rule more specific |
Updated about 3 hours ago
