Automation Rule: Add a new automation rule
gapify_add_automation_ruleCreate a new automation rule for a Gapify account by defining its trigger event, conditions, and actions.
Instructions
Add a new automation rule to account [Automation Rule]
POST /api/v1/accounts/{account_id}/automation_rules
Auth: User API key (header api-access-token).
Body fields: name, description, event_name, active, actions, conditions. Extra fields can be passed via extra_body.
Text values may be written in Persian (Farsi) or any other language and are sent unchanged; IDs, numbers and phone numbers may use Persian or Arabic-Indic digits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Rule name Example: "Add label on message create event" | |
| active | No | Enable/disable automation rule Example: false | |
| actions | No | Array of actions which you want to perform when condition matches, e.g add label support if message contains content help. Example: [{"action_name":"add_label","action_params":["support"]}] | |
| account_id | Yes | The numeric ID of the account | |
| conditions | No | Array of conditions on which conversation filter would work, e.g message content contains text help. Example: [{"attribute_key":"content","filter_operator":"contains","query_operator":"nil","values":["help"]}] | |
| event_name | No | Event that triggers the rule. One of: `conversation_created`, `conversation_updated`, `message_created`. Example: "message_created" | |
| extra_body | No | Additional JSON body fields to merge into the request (for keys not listed above). | |
| description | No | The description about the automation and actions Example: "Add label support and sales on message create event if incoming message content contains text help" |