Skip to main content


The TransferToOperator action allows your bot to switch the dialog to an agent from a customer engagement platform. This can be helpful when the bot cannot solve the customer request without human aid.

Before using this tag, you need to connect one of the available customer engagement platforms to your project.

If you want to switch the dialog to an agent using JavaScript code snippets rather than action tags, use replies with the switch type in $response.replies instead.


All parameters of this tag are optional.

titleOfCloseButtonStringThe title of the button to switch the dialog back to the bot. By selecting this button, the customer can stop communicating with an agent and return to the bot.
messageBeforeTransferStringThe message the customer will see before the dialog switches to an agent. It should notify the customer that an agent is going to speak to them.
If you intend to use HTML markup in the message, omit this parameter and use messageBeforeTransferHtml only.
messageBeforeTransferHtmlStringThe message the customer will see before the dialog switches to an agent, with HTML markup.
If you don’t intend to use HTML markup, omit this parameter and use messageBeforeTransfer only.
prechatAttributesObjectInformation about the customer that should be transferred to an agent. Use the following format for the value:
prechatAttributes =
"Key 1": "Value 1",
"Key 2": "Value 2"
• Key is the name of a field supported the customer engagement platform.
• Value is a piece of information to be sent to an agent when switching the dialog.
This parameter is only used by the Aimychat and LiveTex customer engagement platforms.
ignoreOfflineBooleanIndicates if the customer will wait for a free agent. This parameter determines further actions if there is no agent available on switching the dialog:
• true — the messageForWaitingOperator or messageForWaitingOperatorHtml parameter value will be shown.
• false — the dialog will switch to the state specified in the noOperatorsOnlineState parameter.
messageForWaitingOperatorStringThe text that will be sent to the customer when waiting for a free agent.
If you intend to use HTML markup in the message, omit this parameter and use messageForWaitingOperatorHtml instead.
messageForWaitingOperatorHtmlStringThe text that will be sent to the customer when waiting for a free agent, with HTML markup.
If you don’t intend to use HTML markup, omit this parameter and use messageForWaitingOperator only.
sendMessageHistoryAmountNumberThe number of customer messages that will be sent to an agent.
Specify this parameter only if you have set the sendMessagesToOperator parameter to true.
sendMessagesToOperatorBooleanIndicates if the customer message history should be sent to an agent.
noOperatorsOnlineStateStringThe state the dialog will switch to if there are no free agents on switching the dialog.
dialogCompletedStateStringThe state the dialog will switch to when the dialog with an agent is over. The dialog can be finished by:
• The customer, using the dialog finish button (the titleOfCloseButton parameter);
• An agent, if this feature is supported by the customer engagement platform.
actionsArray of objectsButtons that will be displayed along with the request. Use the following format for the value:
actions =
"buttons": [{
"name": "Button text",
"transition": "/State path"
"type": "buttons"
htmlEnabledBooleanIndicates if HTML markup is used in the messages shown to the customer when switching the dialog to an agent and before waiting for a free one. This parameter determines the parameters whose values will be shown to the customer:
• true — the messageBeforeTransferHtml and messageForWaitingOperatorHtml parameter values will be shown.
• false — the messageBeforeTransfer and messageForWaitingOperator parameter values will be shown.
destinationStringThe ID of the agent group the dialog will be routed to.
This parameter is only used by Aimychat and Operator API.

How to use

state: Switch
intent!: /Switch to agent
titleOfCloseButton = Switch back to the bot
messageBeforeTransfer = You will be switched to an agent.
ignoreOffline = false
messageForWaitingOperator = Hold on. I’m connecting you to one of our agents.
noOperatorsOnlineState = /Switch/Error
dialogCompletedState = /AnythingElse
sendMessageHistoryAmount = 5
sendMessagesToOperator = true

state: Error
a: Unfortunately, all our agents are busy at the moment. We’ll be sure to get back to you soon.
go!: /AnythingElse

state: AnythingElse
a: Is there anything else I can help you with?