curl --request POST \
--url https://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'cloudchat-instance: <cloudchat-instance>' \
--data '
{
"automation_rule": {
"name": "Tag billing conversations",
"event_name": "conversation_created",
"conditions": [
{
"attribute_key": "inbox_id",
"filter_operator": "equal_to",
"values": [
12
],
"query_operator": null
}
],
"actions": [
{
"action_name": "add_label",
"action_params": [
"billing"
]
}
]
}
}
'import requests
url = "https://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create"
payload = { "automation_rule": {
"name": "Tag billing conversations",
"event_name": "conversation_created",
"conditions": [
{
"attribute_key": "inbox_id",
"filter_operator": "equal_to",
"values": [12],
"query_operator": None
}
],
"actions": [
{
"action_name": "add_label",
"action_params": ["billing"]
}
]
} }
headers = {
"cloudchat-instance": "<cloudchat-instance>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'cloudchat-instance': '<cloudchat-instance>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
automation_rule: {
name: 'Tag billing conversations',
event_name: 'conversation_created',
conditions: [
{
attribute_key: 'inbox_id',
filter_operator: 'equal_to',
values: [12],
query_operator: null
}
],
actions: [{action_name: 'add_label', action_params: ['billing']}]
}
})
};
fetch('https://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create', 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://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create",
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([
'automation_rule' => [
'name' => 'Tag billing conversations',
'event_name' => 'conversation_created',
'conditions' => [
[
'attribute_key' => 'inbox_id',
'filter_operator' => 'equal_to',
'values' => [
12
],
'query_operator' => null
]
],
'actions' => [
[
'action_name' => 'add_label',
'action_params' => [
'billing'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"cloudchat-instance: <cloudchat-instance>"
],
]);
$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://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create"
payload := strings.NewReader("{\n \"automation_rule\": {\n \"name\": \"Tag billing conversations\",\n \"event_name\": \"conversation_created\",\n \"conditions\": [\n {\n \"attribute_key\": \"inbox_id\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\n 12\n ],\n \"query_operator\": null\n }\n ],\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"billing\"\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cloudchat-instance", "<cloudchat-instance>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create")
.header("cloudchat-instance", "<cloudchat-instance>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"automation_rule\": {\n \"name\": \"Tag billing conversations\",\n \"event_name\": \"conversation_created\",\n \"conditions\": [\n {\n \"attribute_key\": \"inbox_id\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\n 12\n ],\n \"query_operator\": null\n }\n ],\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"billing\"\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cloudchat-instance"] = '<cloudchat-instance>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"automation_rule\": {\n \"name\": \"Tag billing conversations\",\n \"event_name\": \"conversation_created\",\n \"conditions\": [\n {\n \"attribute_key\": \"inbox_id\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\n 12\n ],\n \"query_operator\": null\n }\n ],\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"billing\"\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"proposal_token": "eyJfcmFpbHMiOnsiZGF0YSI6eyJqdGkiOiI0YjEw...",
"expires_at": "2026-11-12T14:20:00Z",
"kind": "create",
"automation_rule": {
"name": "<string>",
"description": "<string>",
"event_name": "<string>",
"conditions": [
{}
],
"actions": [
{}
],
"execution_delay": 123,
"delay_trigger": "customer_unresponsive",
"active": false,
"order_id": 4
},
"warnings": [
{
"code": "same_event_conflict",
"severity": "medium",
"message": "The active rule \"Route billing\" (#27) also changes team_id on this event and can match the same conversations. When both match, the one that runs last prevails: \"Tag billing conversations\".",
"rule_ids": [
27
]
}
]
}Propose an automation rule
First half of creating a rule. Validates the rule exactly as the confirm will save it and writes nothing: the response previews the rule, lists the warnings it raises, and returns a single-use proposal_token for confirmAutomationRuleCreate. Administrator only — an agent token gets a 403.
The rule is always created off (active: false) and placed after the last rule of its event. active in the payload is refused: turning the rule on is done by a person in the Cloud Chat automations screen.
curl --request POST \
--url https://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'cloudchat-instance: <cloudchat-instance>' \
--data '
{
"automation_rule": {
"name": "Tag billing conversations",
"event_name": "conversation_created",
"conditions": [
{
"attribute_key": "inbox_id",
"filter_operator": "equal_to",
"values": [
12
],
"query_operator": null
}
],
"actions": [
{
"action_name": "add_label",
"action_params": [
"billing"
]
}
]
}
}
'import requests
url = "https://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create"
payload = { "automation_rule": {
"name": "Tag billing conversations",
"event_name": "conversation_created",
"conditions": [
{
"attribute_key": "inbox_id",
"filter_operator": "equal_to",
"values": [12],
"query_operator": None
}
],
"actions": [
{
"action_name": "add_label",
"action_params": ["billing"]
}
]
} }
headers = {
"cloudchat-instance": "<cloudchat-instance>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'cloudchat-instance': '<cloudchat-instance>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
automation_rule: {
name: 'Tag billing conversations',
event_name: 'conversation_created',
conditions: [
{
attribute_key: 'inbox_id',
filter_operator: 'equal_to',
values: [12],
query_operator: null
}
],
actions: [{action_name: 'add_label', action_params: ['billing']}]
}
})
};
fetch('https://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create', 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://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create",
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([
'automation_rule' => [
'name' => 'Tag billing conversations',
'event_name' => 'conversation_created',
'conditions' => [
[
'attribute_key' => 'inbox_id',
'filter_operator' => 'equal_to',
'values' => [
12
],
'query_operator' => null
]
],
'actions' => [
[
'action_name' => 'add_label',
'action_params' => [
'billing'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"cloudchat-instance: <cloudchat-instance>"
],
]);
$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://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create"
payload := strings.NewReader("{\n \"automation_rule\": {\n \"name\": \"Tag billing conversations\",\n \"event_name\": \"conversation_created\",\n \"conditions\": [\n {\n \"attribute_key\": \"inbox_id\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\n 12\n ],\n \"query_operator\": null\n }\n ],\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"billing\"\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cloudchat-instance", "<cloudchat-instance>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create")
.header("cloudchat-instance", "<cloudchat-instance>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"automation_rule\": {\n \"name\": \"Tag billing conversations\",\n \"event_name\": \"conversation_created\",\n \"conditions\": [\n {\n \"attribute_key\": \"inbox_id\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\n 12\n ],\n \"query_operator\": null\n }\n ],\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"billing\"\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/cloudchat/v1/accounts/{accountId}/automation-rules/propose-create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cloudchat-instance"] = '<cloudchat-instance>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"automation_rule\": {\n \"name\": \"Tag billing conversations\",\n \"event_name\": \"conversation_created\",\n \"conditions\": [\n {\n \"attribute_key\": \"inbox_id\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\n 12\n ],\n \"query_operator\": null\n }\n ],\n \"actions\": [\n {\n \"action_name\": \"add_label\",\n \"action_params\": [\n \"billing\"\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"proposal_token": "eyJfcmFpbHMiOnsiZGF0YSI6eyJqdGkiOiI0YjEw...",
"expires_at": "2026-11-12T14:20:00Z",
"kind": "create",
"automation_rule": {
"name": "<string>",
"description": "<string>",
"event_name": "<string>",
"conditions": [
{}
],
"actions": [
{}
],
"execution_delay": 123,
"delay_trigger": "customer_unresponsive",
"active": false,
"order_id": 4
},
"warnings": [
{
"code": "same_event_conflict",
"severity": "medium",
"message": "The active rule \"Route billing\" (#27) also changes team_id on this event and can match the same conversations. When both match, the one that runs last prevails: \"Tag billing conversations\".",
"rule_ids": [
27
]
}
]
}The propose → confirm flow
Every write to an automation rule goes through two calls: a propose that validates the change, previews it and returns a single-useproposal_token,
and a confirm that sends the token back and applies exactly what was
previewed, nothing else. The propose call writes nothing. This section walks
through one round trip for a new rule; the edit pair
(propose,
confirm)
and the reorder pair
(propose,
confirm)
follow the same shape. Every call in this group needs an administrator token.
A person turns rules on and off. A rule created through the API is always
created off, and active in a payload is refused with a 422. Turning a
rule on, or off, is done by someone in the Cloud Chat automations screen. The
same idea covers edits: only a rule that is off can be edited through the API.
To change a rule that is running, propose a new rule with the change, and let
a person turn the new one on and the old one off.
Rules with a non-null managed_by are kept in sync by the ClaudIA integration.
They can be read, but the API refuses to edit them (403) and a new order must
keep them where they are.
1. Propose
Send the rule underautomation_rule. name, event_name, conditions and
actions are required, in the same shape
getAutomationRule
returns them.
POST /cloudchat/v1/accounts/<YOUR_ACCOUNT_ID>/automation-rules/propose-create
{
"automation_rule": {
"name": "Tag billing conversations",
"event_name": "conversation_created",
"conditions": [
{ "attribute_key": "inbox_id", "filter_operator": "equal_to", "values": [12], "query_operator": null }
],
"actions": [
{ "action_name": "add_label", "action_params": ["billing"] }
]
}
}
{
"proposal_token": "eyJfcmFpbHMiOnsiZGF0YSI6eyJqdGkiOiI0YjEw...",
"expires_at": "2026-11-12T14:20:00Z",
"kind": "create",
"automation_rule": {
"name": "Tag billing conversations",
"description": null,
"event_name": "conversation_created",
"conditions": [
{ "attribute_key": "inbox_id", "filter_operator": "equal_to", "values": [12], "query_operator": null }
],
"actions": [
{ "action_name": "add_label", "action_params": ["billing"] }
],
"execution_delay": null,
"delay_trigger": null,
"active": false,
"order_id": 4
},
"warnings": [
{
"code": "same_event_conflict",
"severity": "medium",
"message": "The active rule \"Route billing\" (#27) also changes labels on this event and can match the same conversations. When both match, the one that runs last prevails: \"Tag billing conversations\".",
"rule_ids": [27]
}
]
}
2. Review the warnings
warnings lists risks the change carries, so whoever confirms does it
knowingly. They never block the confirm. Each one has a stable code, a
severity (high or medium), a localized message, and the rule_ids of
the other rules involved.
| Code | Severity | What it means |
|---|---|---|
external_loop | high | On message_created, the rule sends a webhook or a message without being limited to incoming messages. If the receiving system answers through the API, its answer triggers the rule again, in a loop. |
own_platform_webhook | high | The webhook points back to this platform, so the call it makes can trigger rules again. |
claudia_inbox | high | The rule changes status, assignee or team in inboxes where ClaudIA answers, which can take the conversation away from her. |
broad_scope | medium | The rule is not limited to an inbox, so it applies to the whole account. |
same_event_conflict | medium | An active rule on the same event changes the same thing and can match the same conversations. The one that runs last prevails. |
same_event_conflict_delayed | medium | The same conflict, but one of the two rules waits before running (execution_delay), so the order does not decide which value stays and no winner is named. |
cross_event_oscillation | medium | An active rule on another event changes the same thing, and one of the two reads it in its conditions, so the conversation can swing back and forth. |
dispute_winner_changed | medium | Reorder only: the new order changes which of two conflicting active rules prevails. Rules that wait before running are left out of this check. |
code, never on message. If the preview or a warning shows
something you did not intend, discard the token and propose again.
3. Confirm
Send back only theproposal_token, before expires_at. No other body
field is read: the server applies the proposal it stored.
POST /cloudchat/v1/accounts/<YOUR_ACCOUNT_ID>/automation-rules/confirm-create
{
"proposal_token": "eyJfcmFpbHMiOnsiZGF0YSI6eyJqdGkiOiI0YjEw..."
}
getAutomationRule returns.
The token works once, only for the user who proposed, and only on the account
it was issued for. A reused, expired or foreign token answers 400
invalid_proposal. A confirm also answers 409 stale_proposal when the rules
it depends on changed after the proposal: for a create or a reorder, any rule
of the same event; for an edit, the rule itself, for example someone edited it
in the screen. Nothing is written in either case: read the
rules again and propose again.Authorizations
Headers
Your Cloud Chat instance ID — an integer, fixed for your company, told at onboarding. The API overview explains how instances work, how to find yours, and the errors a wrong or missing value produces.
1
Path Parameters
Your Cloud Chat account. It has to be an account your token grants membership on, and it has to live on the instance in the cloudchat-instance header — the two travel together. Account numbers are only unique within an instance, so the same number is a different company on another instance. Usually a mismatched pair fails closed with a 401, because your user does not exist on the other instance — but if your identity happens to exist on both, the call succeeds against the other company's data, silently. Read it and you are looking at the wrong help center; write it and you have stored into the wrong account. Send the two values that were given to you together, and never try a number to see what answers.
1
Body
Response
The proposal. Nothing was written.