How to Configure Operator Panel Webhook
Operator panel webhook allows receiving events from the operator panel (chat creation, operator connection, chat closure) to your external service. This is useful for synchronizing dialogue statuses with a CRM system or logging events.
When to Use Operator Panel Webhook?
Operator panel webhook is suitable for such cases:
- You need to track events in the operator panel (chat creation, operator connection)
- You need to synchronize dialogue statuses with your CRM system
- You need to log operator panel events to an external system
- You need to integrate with an analytics system
Configuration
Step 1: Specify Webhook URL in Action
In the operator_panel__connect_to_operator_with_msg action, specify the event_webhook_url parameter.
Configuration example:
{
"auto_connect_operator": true,
"subject_alias": "support",
"event_webhook_url": "https://your-service.com/webhook/operator-events"
}
Step 2: Configure Processing on Your Service
Your service should:
- Accept POST requests to the specified URL
- Verify request authenticity (if necessary)
- Process different event types
- Return status code 200 for successful processing
Processing example (Node.js):
app.post('/webhook/operator-events', (req, res) => {
const event = req.body;
switch (event.event_name) {
case 'chat_created':
// Process chat creation
console.log('Chat created:', event.chat_id);
break;
case 'operator_connected':
// Process operator connection
console.log('Operator connected:', event.operator.id);
break;
case 'chat_closed':
// Process chat closure
console.log('Chat closed:', event.chat_id);
break;
}
res.status(200).json({ status: 'ok' });
});
Event Types
The following events will be forwarded to the specified URL address:
chat_created— chat createdauto_connected— auto-connection of operatoroperator_connected— operator connectedoperator_disconnected— operator disconnectedchat_closed_by_operator— chat closed by operatorchat_closed— chat closedchat_closed_by_timeout— chat closed by timeoutconnection_timeout— connection timeoutdelegate_chat_on_skill_group— delegate dialogue to another skill groupchat_transferred_to_operator— transfer dialogue to another operator
Event Format
Event format is the same as in Custom Channel. All events contain text and event_name fields.
Example chat_created Event
{
"reply_markup": {
"remove_keyboard": false
},
"chat_id": "34122",
"text": "Chat created",
"event_name": "chat_created",
"client": {
"id": 572338,
"first_name": "Test",
"last_name": "Surname",
"username": "testuername",
"language_code": "uk",
"phone": "+380505776464",
"channel": "telegram"
},
"id": "83317aa1-8ea4-4c05-afed-d7437ff88fbf",
"from": "bot",
"bot_id": 4,
"type": "text"
}
Example operator_connected Event
{
"reply_markup": {
"remove_keyboard": true
},
"chat_id": "34122",
"text": "Operator connected",
"event_name": "operator_connected",
"client": {
"id": 572338,
"first_name": "Test",
"last_name": "Surname",
"username": "testuername",
"language_code": "uk",
"phone": "+380505776464",
"channel": "telegram"
},
"operator": {
"id": 25,
"first_name": "Root",
"last_name": "Admin",
"avatar_img": "https://example.com/avatar.png",
"role": "admin",
"kw_user.email": "[email protected]"
},
"id": "baebdeec-e7b7-4188-bd1d-409f4133507f",
"from": "bot",
"bot_id": 4,
"type": "text"
}
Differences from Custom Channel
Operator Panel Webhook:
- Configured directly in the
operator_panel__connect_to_operator_with_msgaction - Sends only events from the operator panel
- Does not require separate channel configuration
Custom Channel:
- Requires channel configuration in bot settings
- Sends all messages and events
- More flexible for full integration
Limitations
- URL must be accessible from the ConnectiveOne server
- Only HTTP and HTTPS protocols are supported
- Request timeout depends on system settings
- It is recommended to use HTTPS for security
Related Articles
- Integration via Custom Channel
- What are integrations
- Connect chat to operator — configuring connection to operator