POST

Entries.RunAutomation

Run one active automation for the customers linked to selected entry rows. Matches the dashboard Entry-filter Run Automation button: select entry rows, choose an automation, and the automation runs on each related customer. For a single-customer custom tab, send customer_id with the selected entry row ids (mode=tab) to use the tab-scoped dashboard path.

Required Choice

Send at least one complete option from the list below.

OptionAccepted FieldsExplanation
1ids or row_ids or entry_ids or entry_row_ids or selected_entry_ids or customer_ids or customers or selected_cust_id or customer_idOne of these values is required to create the record.

Permissions

  • User must be logged in with a valid bearer token.
  • The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
  • Returned or changed records are limited by the user permissions, team access, folder access, and account settings.

Action

  • Validates automation_id belongs to the account and is active.
  • Resolves selected entry rows to customers, or uses customer_ids / customer_id directly.
  • Calls the same dashboard PHP runners used by the UI.

Push Service

Emits realtime automation.run after a successful bulk run.

Automation

Runs the chosen automation_event id through run_automations_by_id for each selected customer/entry row, same as the dashboard.

Special Instructions

  • On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
  • Required: automation_id AND at least one non-empty target: entry row ids (ids / aliases) OR customer ids (customer_ids / customer_id / aliases).
  • Empty strings do not count. Example that fails: ids= and customer_id= with only automation_id + entry_id.
  • Use Entries.AutomationsList (or AutomationEvents.List with automation_status=1) to fill the automation picker.
  • Preferred App fields: automation_id + ids (entry row ids from Entries.List). The API resolves each row customer_id and runs the automation for those customers.
  • Dashboard-compatible aliases: selected_cust_id can be comma-separated customer ids (admin Entry-filter JS), and selected_all_cust_id is the single customer id for tab-scoped runs.
  • Maximum 500 selected ids per request.
  • Existing Entries.Add/Update/Delete still auto-run entries.created/updated/deleted. This route is only for manual bulk Run Automation.

Required Parameters

NameTypeSampleExplanation
automation_id
post
int2827Active automation id from Entries.AutomationsList / AutomationEvents.List. Always required.
ids
post
string|array66aa00000000000000000001,66aa00000000000000000002Required target option 1/3: selected entry row ids from Entries.List (non-empty; empty string fails). Send this OR customer_ids OR customer_id. Aliases: row_ids, entry_ids, entry_row_ids, selected_entry_ids.
customer_ids
post
string|array123,456Required target option 2/3: run directly for these customers (non-empty). Send this OR ids OR customer_id. Alias: selected_cust_id. Also accepts customers.
customer_id
post
int123Required target option 3/3: single customer id (non-empty). Send this OR ids OR customer_ids. With entry row ids (or mode=tab) runs the custom-tab path. Alias: selected_all_cust_id.

Optional Parameters

NameTypeSampleWhat it gives
entry_id
post
int7Optional entry/tab setting id to scope selected row lookup. Alias: tab_id. Not a substitute for ids / customer_ids.
mode
post
stringtabUse tab or entry_rows to force the custom-tab runner. Default resolves customers from selected entry rows.
automation_type
post
stringmanualOptional event type for tab-scoped runs (dashboard data_type). Defaults to the automation event.

Authentication

Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Entries.RunAutomation",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "automation_id": "2827",
        "ids": "66aa00000000000000000001",
        "entry_id": "7"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Entries.RunAutomation",
    "url_domain": "https:\/\/{domain}\/app\/Entries.RunAutomation"
}

Endpoint

POST /app/Entries.RunAutomation
POST https://{user}.bull36.com/app/Entries.RunAutomation
POST https://{domain}/app/Entries.RunAutomation

Sample Output

{
    "success": 1,
    "message": "Success",
    "automation_id": 2827,
    "mode": "entries_to_customers",
    "customer_ids": [
        "123"
    ],
    "count": 1
}

JavaScript Example

const token = 'YOUR TOKEN';
const autos = await fetch('/app/Entries.AutomationsList', { method: 'POST', headers: { Authorization: 'Bearer ' + token } }).then(r => r.json());
const automationId = autos.data[0].id;
const body = new URLSearchParams({
  automation_id: String(automationId),
  ids: '66aa00000000000000000001',
  entry_id: '7',
});
const res = await fetch('/app/Entries.RunAutomation', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());

Error Example

{
    "success": "0",
    "error": "missing_required_parameter",
    "message": "Missing required parameter: ids or row_ids or entry_ids or entry_row_ids or selected_entry_ids or customer_ids or customers or selected_cust_id or customer_id",
    "missing": [
        "ids or row_ids or entry_ids or entry_row_ids or selected_entry_ids or customer_ids or customers or selected_cust_id or customer_id"
    ]
}