Automate conversation workflows with rules that assign operators, apply tags, or close conversations based on conditions.
Automation rules let you define workflows that run automatically when specific conditions are met. Instead of manually assigning conversations or tagging them, rules handle these tasks in the background so operators can focus on responding to visitors.
Each automation rule has three parts:
auto_assign, auto_tag, or
auto_close)Rules can be enabled or disabled without deleting them, making it easy to pause a rule for testing and re-enable it later. Deleting a rule requires admin role.
Route conversations to a specific operator automatically when the condition matches. Use this to direct technical questions to the engineering team or sales inquiries to the right account manager.
{
"name": "Route billing questions to Sarah",
"type": "auto_assign",
"condition": {
"field": "keyword",
"value": "invoice billing payment"
},
"action": {
"operatorId": "op-uuid"
},
"enabled": true
}Apply a tag to conversations matching the condition. Tags help you categorize conversations for reporting and filtering without manual effort.
{
"name": "Tag refund requests",
"type": "auto_tag",
"condition": {
"field": "keyword",
"value": "refund money back"
},
"action": {
"tag": "refund"
},
"enabled": true
}Automatically close conversations after a period of inactivity. This keeps the conversation list clean and prevents stale conversations from cluttering operator queues.
{
"name": "Close inactive conversations after 48 hours",
"type": "auto_close",
"condition": {
"field": "inactivity",
"hours": 48
},
"action": {
"message": "This conversation has been closed due to inactivity. Start a new chat if you need further help."
},
"enabled": true
}Conditions determine when a rule fires. Three condition types are available:
Triggers when the first message in a conversation contains any of the specified keywords. Matching is substring-based within the message content.
{
"field": "keyword",
"value": "invoice billing payment"
}Multiple keywords in the value field are space-separated. The rule
triggers if any one of them appears in the message.
Triggers based on the detected language of the visitor's message. Use this to route international visitors to operators who speak their language.
{
"field": "language",
"value": "pl"
}The language value should be an ISO 639-1 code.
Triggers when a conversation has had no new messages for a specified
number of hours. Only applies to the auto_close rule type.
{
"field": "inactivity",
"hours": 48
}POST /api/automation-rules{
"name": "Route technical issues to dev team",
"type": "auto_assign",
"condition": {
"field": "keyword",
"value": "bug error crash technical"
},
"action": {
"operatorId": "op-uuid"
},
"enabled": true
}GET /api/automation-rulesReturns all rules for the organization, ordered by most recently created:
{
"items": [
{
"id": "rule-uuid",
"name": "Route billing questions to Sarah",
"type": "auto_assign",
"condition": {"field": "keyword", "value": "invoice billing"},
"action": {"operatorId": "op-uuid"},
"enabled": true,
"createdAt": "2025-03-15T10:00:00Z"
}
]
}Update any property of a rule, or toggle the enabled flag to
temporarily disable it:
PATCH /api/automation-rules/:id{
"enabled": false,
"condition": {
"field": "keyword",
"value": "updated keywords"
}
}Only the fields you include in the request body are updated. Omitted fields keep their existing values.
DELETE /api/automation-rules/:idThis requires admin role. The rule is permanently removed.
Rule Order
Rules are evaluated in creation order. When multiple rules could match
the same conversation, the first matching rule wins. Plan your rule
order carefully, and use the enabled flag to test new rules before
activating them alongside existing ones.
| Method | Endpoint | Description |
|---|---|---|
POST | /api/automation-rules | Create an automation rule |
GET | /api/automation-rules | List all automation rules |
PATCH | /api/automation-rules/:id | Update a rule |
DELETE | /api/automation-rules/:id | Delete a rule (admin only) |
All endpoints require authentication. Deletion requires admin role.
Last updated: Jul 2, 2026
Was this page helpful?