Hand over an Instagram chat from the AI agent to an SMSBAT Omni operator
This guide shows how to pass a conversation from the AI agent to a live operator in SMSBAT Omni: you create a chat integration in MyCode.Bot, import a ready-made schema and test the handover in Instagram Direct.
What you get
- When the AI agent cannot help, the conversation appears in SMSBAT Omni with a note for the operator: customer, topic, reason and summary.
- The operator answers in the same Direct thread, and the bot stays silent meanwhile.
- When the operator closes the chat, the bot thanks the customer and shows the menu again.
Before you start
- Connect Instagram to SMSBAT Omni and create an API token for your organization.
- Set up the Instagram bot with AI: a bot with an active AI agent.
Download the schema
Download the schema (JSON, 35 KB)
The file uses the imaginary Demo Shop with English texts. It has no keys, customer data, agent or chat integration: you select your own in step 3.
Step 1. Create a chat integration
- Open the page of your bot in MyCode.Bot, tab Chat integrations, and press Create.
- Fill in the form:
| Field | Value |
|---|---|
| Name | Any name, for example Smsbat chats. |
| Provider | Smsbat |
| Credentials | Your SMSBAT Omni organization credentials. If the list is empty, press Create credential and add the organization API token. |
- Leave Integration enabled switched on and press Create.
Step 2. Import the schema
- Open the schema of your bot on the Canvas.
- Press the import button on the bottom panel, choose the downloaded file and press Import.
The schema is the Instagram bot with AI plus the Omni operator node.
Step 3. Select the agent and the integration
- In the AI agent node select your agent.
- In the Omni operator node select the chat integration from step 1.
The note for the operator is built automatically from the customer’s profile and the agent’s answer:
| Line of the note | Where it comes from |
|---|---|
| Client | Name and nickname from the Instagram profile. |
| Topic | The topic field: products, sizes, delivery, payment, returns, order or other. |
| Reason | The handoff_reason field: why a person is needed, for example no answer in the knowledge base, an order question, a complaint or a request to talk to a person. |
| Summary | The summary field: one sentence for the manager about what the customer wants. |
How the bot decides
The Manager needed? condition sends the conversation to the Omni operator node when the agent asks for a person, an error occurs or the answer is empty. In all other cases the customer gets the agent’s answer.
While the chat is with an operator, the customer sees the Connecting to a manager screen with your working hours and the ✅ End chat button. When the operator closes the chat, the bot shows the Chat closed screen with the menu.
Step 4. Test the handover
- Write to your Instagram account in Direct from a different account and ask
Where is my order #12345? - The bot says that it is connecting a manager and shows the working hours.
- In SMSBAT Omni a new conversation appears with the note from the AI.
- Accept the chat and reply: the customer gets your message in the same Direct thread, and the bot does not answer.
- Close the chat: the bot thanks the customer and shows the menu.
Replace the demo content
| Screen | What to change |
|---|---|
| Connecting to a manager | Your working hours and the wording. |
| Chat closed | The text after the operator closes the chat. |
The other screens are the same as in the Instagram bot without AI.
Common questions
The conversation does not appear in SMSBAT Omni. Check that the chat integration is enabled, that its credentials belong to the organization where Instagram is connected, and that the Omni operator node uses this integration.
What does the customer see after writing outside working hours? The same Connecting to a manager screen. The conversation waits in SMSBAT Omni until an operator accepts it.
Can the customer leave the operator chat? Yes, with the ✅ End chat button. The bot then shows the Chat closed screen.