addAutomaticAction
Creates a new automatic action (macro) or updates an existing one if automatic_action_id is provided.
Input parameters
Output data:
A sample request in PHP:
| type | text | Type of automatic action |
| automatic_action_id | int | Automatic action ID (optional, for updating existing action) |
| trigger_type | int | Trigger type |
| trigger_condition | text | Trigger condition data |
| group_id | int | Group ID |
| enabled | bool | Is action enabled (default: true) |
| description | text | Action description |
| conditions | array | List of conditions |
| | - condition_id | int | Condition ID (for updating existing condition) |
| | - condition_type | int | Condition type |
| | - condition_data | array | Condition data |
| tasks | array | List of tasks |
| | - task_id | int | Task ID (for updating existing task) |
| | - task_type | int | Task type |
| | - task_data | array | Task data |
Output data
The method returns the data in JSON format.
| status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
| automatic_action_id | int | Created/updated automatic action ID |
| warning | text | Warning message if action was disabled due to validation |
Sample
Input data:Output data:
A sample request in PHP: