Skip to Content
inclamoDocs

Add a new automation rule

POST
/api/v1/accounts/{account_id}/automation_rules

Add a new automation rule to account

Authorization

headerAuthorizationBearer <token>

Authenticate with Authorization: Bearer <token> using a user API token from Profile Settings. Available in Chatwoot v4.19.0 and later.

Path Parameters

account_id*integer

The numeric ID of the account

Request Body

application/json
  1. body
name?string

Rule name

description?string

The description about the automation and actions

event_name?string

The event when you want to execute the automation actions

Value in"conversation_created""conversation_updated""conversation_resolved""message_created"
active?boolean

Enable/disable automation rule

actions?array<>

Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.

conditions?array<>

Array of conditions on which conversation filter would work, e.g message content contains text help.

Response Body

Success

application/json
  1. response
payload?array<>|

Response payload that contains automation rule(s)

Example Request
curl -X POST 'https://helpdesk.inclamo.com/api/v1/accounts/0/automation_rules' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "payload": [    {      "id": 0,      "account_id": 0,      "name": "string",      "description": "string",      "event_name": "conversation_created",      "conditions": [        {          "values": [            "string"          ],          "attribute_key": "string",          "query_operator": "string",          "filter_operator": "string"        }      ],      "actions": [        {          "action_name": "string",          "action_params": [            "string"          ]        }      ],      "created_on": 0,      "active": true    }  ]}