POST

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

NameTypeSampleExplanation
name
post
stringNew lead triggerDisplay name for the automation trigger.
event
post
stringadd_leadTrigger key that starts the automation. Use one of the allowed event keys in the full Automation docs.

Optional Parameters

NameTypeSampleWhat it gives
position
post
int/string1Optional UI position/order value for automation screens.
automation
post
int1Optional display/order group. If omitted, the server sets the next value automatically. This is not the action flow_id.
automation_status
post
int11 active, 0 disabled. If omitted, Add defaults to 1 active. Send 0 while building/reviewing, then call Activate when ready.
subscription_id
post
int/string7Legacy single subscription/product id when using subscription trigger filters.
subscriptions_ids
post
json/string[7,8]Subscription/product ids for subscription events.
par
post
stringsourcePrimary 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.
val
post
string/jsonwebsiteIncluded values for par. For excluded values send the value prefixed with ! or use the UI exclude convention.
par2
post
stringtagSecond filter dimension applied as another condition when the event supports it.
val2
post
string/jsonvipIncluded/excluded values for par2.
extra_param
post
string/jsoncf-budget > 1000Extra include value, commonly for custom-field or event-specific filters.
extra_param2
post
string/jsoncf-city = Tel AvivSecond extra include value.
exclude_extra_param
post
string/jsontestExtra exclude value, commonly for custom-field filters.
exclude_extra_param2
post
string/jsondemoSecond extra exclude value.
tag_name
post
string/idvipTag key/name used by tag filter helpers.
tag_name2
post
string/idhotSecond tag key/name used by par2 tag filters.
internal_status
post
json/string{"1":["5"]}Folder-to-status or tab-to-status map for internal status and tab status events.
order_id
post
int/string2Order/document type id for order/document trigger families.
delay
post
int60Delay before the trigger starts running, stored in minutes.
from_date
post
date2026-07-22Start 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_date
post
date2026-07-30End 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_sum
post
number100Minimum payment sum for payment_sum filters.
to_payment_sum
post
number500Maximum payment sum for payment_sum filters.
value_compare
post
number1000Single amount threshold for greater/less/equal comparisons.
from_amt
post
number500Minimum amount for amount-between filters.
to_amt
post
number2500Maximum amount for amount-between filters.
date_compare
post
int30Minute threshold for WhatsApp/message time filters.
allow_to_update_customer_also
post
int1For 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.Add

Sample 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"
}