Create automation rule
create_automation_ruleCreate an automation rule: when EVENT happens and CONDITIONS match, run ACTIONS. The conditions and actions schemas list the exact attribute keys, operators and values each event accepts. The ids and titles an action or condition needs come from list_labels, list_agents, list_teams and list_inboxes. Actions that call an external address or send attachments are not available.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"event_name": "<event_name>",
"conditions": "<conditions>",
"actions": "<actions>"
},
"name": "create_automation_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| active | No | ||
| actions | Yes | What happens when the rule matches, in order. action_params per action: change_priority → exactly one of low, medium, high, urgent, nil; change_status → exactly one of open, resolved, pending, snoozed; assign_agent → one agent id (list_agents), or the string "nil" to unassign; assign_team → one team id (list_teams), or the string "nil" to unassign; add_label → label titles (list_labels), one or more; remove_label → label titles, one or more; send_message → the message text (one string); send_email_transcript → one string of comma-separated email addresses; mute_conversation → none; snooze_conversation → none; resolve_conversation → none; send_whatsapp_flow → one object: {flow_id (list_whatsapp_flows, published only), flow_cta (the button label, at most 30 characters), body, and optionally header, footer, initial_screen}; send_email_to_team → one object {"team_ids": [ids], "message": "text"}. | |
| conditions | Yes | When the rule applies. Every condition after the first needs a query_operator (and / or); the first has none. attribute_key must be one the event supports: message_created: message_type, content, email, inbox_id, conversation_language, phone_number | conversation_created: status, browser_language, mail_subject, country_code, phone_number, referer, email, inbox_id, conversation_language, priority | conversation_updated: status, browser_language, mail_subject, country_code, referer, phone_number, assignee_id, team_id, email, inbox_id, conversation_language, priority | conversation_opened: browser_language, email, mail_subject, country_code, referer, assignee_id, phone_number, team_id, inbox_id, conversation_language, priority. Operators per attribute: message_type (equal_to/not_equal_to), content (equal_to/not_equal_to/contains/does_not_contain), email (equal_to/not_equal_to/contains/does_not_contain), inbox_id (equal_to/not_equal_to/is_present/is_not_present), conversation_language (equal_to/not_equal_to), phone_number (equal_to/not_equal_to/contains/does_not_contain/starts_with), status (equal_to/not_equal_to), browser_language (equal_to/not_equal_to), mail_subject (equal_to/not_equal_to/contains/does_not_contain), country_code (equal_to/not_equal_to), referer (equal_to/not_equal_to/contains/does_not_contain), priority (equal_to/not_equal_to), assignee_id (equal_to/not_equal_to/is_present/is_not_present), team_id (equal_to/not_equal_to/is_present/is_not_present). Values: status → open, resolved, pending, snoozed; priority → urgent, high, medium, low, nil (no priority); message_type → incoming, outgoing; inbox_id → inbox ids (list_inboxes); assignee_id → agent ids (list_agents); team_id → team ids (list_teams); country_code → ISO 3166-1 alpha-2, e.g. CO, US; browser_language → ISO 639-1, e.g. es, en; conversation_language → ISO 639-1, e.g. es, en; content → text fragments; contains matches any of them; phone_number → E.164, e.g. +573001234567; email → contact email; mail_subject → email subject text; referer → page URL the widget was opened from. A custom attribute (list_custom_attributes) is an attribute_key of its own with custom_attribute_type set; is_present / is_not_present take no values; attribute_changed (conversation_updated only) takes {"from": [...], "to": [...]} objects. | |
| event_name | Yes | ||
| description | No |