curl --request POST \
--url https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules \
--header 'Content-Type: application/json' \
--header 'api-access-token: <api-key>' \
--data '
{
"name": "Add label on message create event",
"description": "Add label support and sales on message create event if incoming message content contains text help",
"event_name": "message_created",
"active": true,
"actions": [
{
"action_name": "add_label",
"action_params": [
"support"
]
}
],
"conditions": [
{
"attribute_key": "content",
"filter_operator": "contains",
"query_operator": "OR",
"values": [
"help"
]
}
]
}
'import requests
url = "https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules"
payload = {
"name": "Add label on message create event",
"description": "Add label support and sales on message create event if incoming message content contains text help",
"event_name": "message_created",
"active": True,
"actions": [
{
"action_name": "add_label",
"action_params": ["support"]
}
],
"conditions": [
{
"attribute_key": "content",
"filter_operator": "contains",
"query_operator": "OR",
"values": ["help"]
}
]
}
headers = {
"api-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Add label on message create event',
description: 'Add label support and sales on message create event if incoming message content contains text help',
event_name: 'message_created',
active: true,
actions: [{action_name: 'add_label', action_params: ['support']}],
conditions: [
{
attribute_key: 'content',
filter_operator: 'contains',
query_operator: 'OR',
values: ['help']
}
]
})
};
fetch('https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Add label on message create event',
'description' => 'Add label support and sales on message create event if incoming message content contains text help',
'event_name' => 'message_created',
'active' => true,
'actions' => [
[
'action_name' => 'add_label',
'action_params' => [
'support'
]
]
],
'conditions' => [
[
'attribute_key' => 'content',
'filter_operator' => 'contains',
'query_operator' => 'OR',
'values' => [
'help'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules"
payload := strings.NewReader("{\n \"name\": \"Add label on message create event\",\n \"description\": \"Add label support and sales on message create event if incoming message content contains text help\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"support\"\n ]\n }\n ],\n \"conditions\": [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"OR\",\n \"values\": [\n \"help\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules")
.header("api-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Add label on message create event\",\n \"description\": \"Add label support and sales on message create event if incoming message content contains text help\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"support\"\n ]\n }\n ],\n \"conditions\": [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"OR\",\n \"values\": [\n \"help\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Add label on message create event\",\n \"description\": \"Add label support and sales on message create event if incoming message content contains text help\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"support\"\n ]\n }\n ],\n \"conditions\": [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"OR\",\n \"values\": [\n \"help\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"payload": [
{
"id": 123,
"account_id": 123,
"name": "Add label on message create event",
"description": "Add label support and sales on message create event if incoming message content contains text help",
"event_name": "message_created",
"conditions": [
{
"attribute_key": "content",
"filter_operator": "contains",
"values": [
"help"
],
"query_operator": "and"
}
],
"actions": [
{
"action_name": "add_label",
"action_params": [
"support",
"sales"
]
}
],
"created_on": 123,
"active": true
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Add a new automation rule
Add a new automation rule to account
curl --request POST \
--url https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules \
--header 'Content-Type: application/json' \
--header 'api-access-token: <api-key>' \
--data '
{
"name": "Add label on message create event",
"description": "Add label support and sales on message create event if incoming message content contains text help",
"event_name": "message_created",
"active": true,
"actions": [
{
"action_name": "add_label",
"action_params": [
"support"
]
}
],
"conditions": [
{
"attribute_key": "content",
"filter_operator": "contains",
"query_operator": "OR",
"values": [
"help"
]
}
]
}
'import requests
url = "https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules"
payload = {
"name": "Add label on message create event",
"description": "Add label support and sales on message create event if incoming message content contains text help",
"event_name": "message_created",
"active": True,
"actions": [
{
"action_name": "add_label",
"action_params": ["support"]
}
],
"conditions": [
{
"attribute_key": "content",
"filter_operator": "contains",
"query_operator": "OR",
"values": ["help"]
}
]
}
headers = {
"api-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Add label on message create event',
description: 'Add label support and sales on message create event if incoming message content contains text help',
event_name: 'message_created',
active: true,
actions: [{action_name: 'add_label', action_params: ['support']}],
conditions: [
{
attribute_key: 'content',
filter_operator: 'contains',
query_operator: 'OR',
values: ['help']
}
]
})
};
fetch('https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Add label on message create event',
'description' => 'Add label support and sales on message create event if incoming message content contains text help',
'event_name' => 'message_created',
'active' => true,
'actions' => [
[
'action_name' => 'add_label',
'action_params' => [
'support'
]
]
],
'conditions' => [
[
'attribute_key' => 'content',
'filter_operator' => 'contains',
'query_operator' => 'OR',
'values' => [
'help'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules"
payload := strings.NewReader("{\n \"name\": \"Add label on message create event\",\n \"description\": \"Add label support and sales on message create event if incoming message content contains text help\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"support\"\n ]\n }\n ],\n \"conditions\": [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"OR\",\n \"values\": [\n \"help\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules")
.header("api-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Add label on message create event\",\n \"description\": \"Add label support and sales on message create event if incoming message content contains text help\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"support\"\n ]\n }\n ],\n \"conditions\": [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"OR\",\n \"values\": [\n \"help\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat.domix.ai/api/v1/accounts/{account_id}/automation_rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Add label on message create event\",\n \"description\": \"Add label support and sales on message create event if incoming message content contains text help\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"support\"\n ]\n }\n ],\n \"conditions\": [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"OR\",\n \"values\": [\n \"help\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"payload": [
{
"id": 123,
"account_id": 123,
"name": "Add label on message create event",
"description": "Add label support and sales on message create event if incoming message content contains text help",
"event_name": "message_created",
"conditions": [
{
"attribute_key": "content",
"filter_operator": "contains",
"values": [
"help"
],
"query_operator": "and"
}
],
"actions": [
{
"action_name": "add_label",
"action_params": [
"support",
"sales"
]
}
],
"created_on": 123,
"active": true
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Authorizations
This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.
Path Parameters
The numeric ID of the account
Body
Rule name
"Add label on message create event"
The description about the automation and actions
"Add label support and sales on message create event if incoming message content contains text help"
The event when you want to execute the automation actions
conversation_created, conversation_updated, conversation_resolved, message_created "message_created"
Enable/disable automation rule
Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.
Array of conditions on which conversation filter would work, e.g message content contains text help.
Response
Success
- object[]
- object
Hide child attributes
Hide child attributes
The ID of the automation rule
Account Id
The name of the rule
"Add label on message create event"
Description to give more context about the rule
"Add label support and sales on message create event if incoming message content contains text help"
Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)
conversation_created, conversation_updated, message_created "message_created"
The timestamp when the rule was created
Enable/disable automation rule