Create automation rule
POST
/v1/automation/rulesAuthorization
bearerAuthbearerAuthrequiredor
apiKeyAuthapiKeyAuthrequiredRequest body
requiredapplication/jsonactionsAutomationRuleAction[] | nullrequiredOrdered action list
Show propertiesHide properties
Array of
AutomationRuleActionagent_idstringfixed_agent_idstringlabelstringlabel_idstringstrategystringtypestringrequiredenabledbooleanWhether this rule is active (defaults to true)
namestringrequiredRule name
min length 1
scopeAutomationRuleScopeOptional organization-local rule scope
Show propertiesHide properties
channel_typestringconversation_idstringtriggerAutomationRuleTriggerrequiredAutomation trigger configuration
Show propertiesHide properties
eventstringeventsstring[] | nullResponses
200OK
actionsAutomationRuleAction[] | nullrequiredShow propertiesHide properties
Array of
AutomationRuleActionagent_idstringfixed_agent_idstringlabelstringlabel_idstringstrategystringtypestringrequiredcreated_atstringrequiredcreated_bystringrequiredenabledbooleanrequiredidstringrequirednamestringrequiredorganization_idstringrequiredscopeAutomationRuleScoperequiredShow propertiesHide properties
channel_typestringconversation_idstringtriggerAutomationRuleTriggerrequiredShow propertiesHide properties
eventstringeventsstring[] | null400Bad Request
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring401Unauthorized
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring403Forbidden
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring422Unprocessable Entity
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring500Internal Server Error
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstringRequest
curl -X POST "/v1/automation/rules" \
-H "Content-Type: application/json" \
-d '{
"actions": [
{
"agent_id": "string",
"fixed_agent_id": "string",
"label": "string",
"label_id": "string",
"strategy": "string",
"type": "string"
}
],
"enabled": true,
"name": "string",
"scope": {
"channel_type": "string",
"conversation_id": "string"
},
"trigger": {
"event": "string",
"events": [
"string"
]
}
}'const response = await fetch("/v1/automation/rules", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"actions": [
{
"agent_id": "string",
"fixed_agent_id": "string",
"label": "string",
"label_id": "string",
"strategy": "string",
"type": "string"
}
],
"enabled": true,
"name": "string",
"scope": {
"channel_type": "string",
"conversation_id": "string"
},
"trigger": {
"event": "string",
"events": [
"string"
]
}
})
});import requests
response = requests.post(
"/v1/automation/rules",
headers={
"Content-Type": "application/json"
},
json={
"actions": [
{
"agent_id": "string",
"fixed_agent_id": "string",
"label": "string",
"label_id": "string",
"strategy": "string",
"type": "string"
}
],
"enabled": True,
"name": "string",
"scope": {
"channel_type": "string",
"conversation_id": "string"
},
"trigger": {
"event": "string",
"events": [
"string"
]
}
},
)Response
{
"actions": [
{
"agent_id": "string",
"fixed_agent_id": "string",
"label": "string",
"label_id": "string",
"strategy": "string",
"type": "string"
}
],
"created_at": "string",
"created_by": "string",
"enabled": true,
"id": "string",
"name": "string",
"organization_id": "string",
"scope": {
"channel_type": "string",
"conversation_id": "string"
},
"trigger": {
"event": "string",
"events": [
"string"
]
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}