AutomationEvents.Add
Create an automation trigger. Add returns the trigger id; use that returned id as flow_id when adding actions.
Permissions
User must be logged in and allowed to manage automation/settings for this account.
Action
Creates a trigger definition and stores filters for the active account. The server sets the next automation order if automation is omitted.
Push Service
Pushes automationevents.add.created to users watching automation/settings.
Automation
No business automation runs while editing automation configuration. It runs later only when an active trigger event happens.
Special Instructions
End-to-end: call AutomationEvents.Add, store response.id, call AutomationActions.Add with flow_id=response.id, then call AutomationEvents.Activate when ready. If you omit automation_status, the trigger is created active (1), so send automation_status=0 while building/reviewing. Full instructions: /docs/generated/app-route-diffs/AutomationEvents.Add.md Sample curl: curl -X POST https://{domain}/app/AutomationEvents.Add \ -H 'Authorization: Bearer YOUR TOKEN' \ -d 'name=New lead trigger' \ -d 'event=add_lead' \ -d 'automation_status=0' \ -d 'par=source' \ -d 'val=website'
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
namepost | string | New lead trigger | Display name for the automation trigger. |
eventpost | string | add_lead | Trigger key that starts the automation. Use one of the allowed event keys in the full Automation docs. |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
positionpost | int/string | 1 | Optional UI position/order value for automation screens. |
automationpost | int | 1 | Optional display/order group. If omitted, the server sets the next value automatically. This is not the action flow_id. |
automation_statuspost | int | 1 | 1 active, 0 disabled. If omitted, Add defaults to 1 active. Send 0 while building/reviewing, then call Activate when ready. |
subscription_idpost | int/string | 7 | Legacy single subscription/product id when using subscription trigger filters. |
subscriptions_idspost | json/string | [7,8] | Subscription/product ids for subscription events. |
parpost | string | source | Primary filter dimension: source, folder, same_as_folder, tag, status, custom_fields, mission_steps, pdf_signer, project_column, internal_status, tabs_list, payment_sum, ticket_department, etc. |
valpost | string/json | website | Included values for par. For excluded values send the value prefixed with ! or use the UI exclude convention. |
par2post | string | tag | Second filter dimension applied as another condition when the event supports it. |
val2post | string/json | vip | Included/excluded values for par2. |
extra_parampost | string/json | cf-budget > 1000 | Extra include value, commonly for custom-field or event-specific filters. |
extra_param2post | string/json | cf-city = Tel Aviv | Second extra include value. |
exclude_extra_parampost | string/json | test | Extra exclude value, commonly for custom-field filters. |
exclude_extra_param2post | string/json | demo | Second extra exclude value. |
tag_namepost | string/id | vip | Tag key/name used by tag filter helpers. |
tag_name2post | string/id | hot | Second tag key/name used by par2 tag filters. |
internal_statuspost | json/string | {"1":["5"]} | Folder-to-status or tab-to-status map for internal status and tab status events. |
order_idpost | int/string | 2 | Order/document type id for order/document trigger families. |
delaypost | int | 60 | Delay before the trigger starts running, stored in minutes. |
from_datepost | date | 2026-07-22 | Start date for date/payment filters. Use UTC Y-m-d. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
to_datepost | date | 2026-07-30 | End date for date/payment filters. Use UTC Y-m-d. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
from_payment_sumpost | number | 100 | Minimum payment sum for payment_sum filters. |
to_payment_sumpost | number | 500 | Maximum payment sum for payment_sum filters. |
value_comparepost | number | 1000 | Single amount threshold for greater/less/equal comparisons. |
from_amtpost | number | 500 | Minimum amount for amount-between filters. |
to_amtpost | number | 2500 | Maximum amount for amount-between filters. |
date_comparepost | int | 30 | Minute threshold for WhatsApp/message time filters. |
allow_to_update_customer_alsopost | int | 1 | For add_lead triggers, allow updating an existing customer when the trigger runs. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/AutomationEvents.Add",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"name": "New lead trigger",
"event": "add_lead",
"automation_status": "0",
"par": "source",
"val": "website"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/AutomationEvents.Add",
"url_domain": "https:\/\/{domain}\/app\/AutomationEvents.Add"
}Endpoint
POST /app/AutomationEvents.Add
POST https://{user}.bull36.com/app/AutomationEvents.Add
POST https://{domain}/app/AutomationEvents.AddSample Output
{
"success": "1",
"message": "AutomationEvents.Add created",
"id": "123",
"data": {
"id": "123",
"event": "add_lead",
"automation": "1"
},
"automation_event": null,
"socket_event": "automationevents.add.created"
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('name', 'New lead trigger');
body.set('event', 'add_lead');
body.set('automation_status', '0');
body.set('par', 'source');
body.set('val', 'website');
const res = await fetch('/app/AutomationEvents.Add', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
body
});
const data = await res.json();
console.log(data);Error Example
{
"success": "0",
"message": "Missing required parameter: name, event"
}