POST
Ticket.AutomationAdd
Alias of Ticket.AutomationSave create mode (omit id). Same parameters as Ticket.AutomationSave. Requires manager permission.
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
- Runs the Ticket.AutomationAdd function and returns JSON.
Push Service
No push is sent because this function only reads data or returns helper information.
Automation
No automation is run for this function.
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.
- Prefer Ticket.AutomationSave docs for the full parameter list.
- Omit id to create a new ticket_automation rule.
- Send email: email_to_team / email_user_ids = staff notify; email_to_customer + email_template_id = customer mail template (0 = default). See Ticket.AutomationSave.
Required Parameters
No body parameters are required for this function.
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
titlepost | string | Follow up unassigned | Rule title. |
after_minutespost | int | 15 | Delay minutes (min 1, default 15). |
condition_typepost | string | not_assigned | not_assigned or in_status. |
condition_statusespost | array|string | 1,3 | Status ids when condition_type=in_status. |
action_send_emailpost | int | 1 | Enable email action (0/1). |
email_to_teampost | int | 1 | Email team / staff notify (0/1). |
email_to_customerpost | int | 0 | Email customer (0/1). |
email_user_idspost | array|string | 47 | Specific email user ids (staff). |
email_template_idpost | int | 0 | Customer email template id (email_template.id). 0 = default. Alias: customer_email_template_id. |
action_create_missionpost | int | 0 | Enable mission action (0/1). |
mission_textpost | string | Follow up | Mission text (or use mission_config). |
action_row_colorpost | int | 0 | Enable row color (0/1). |
row_colorpost | string | #ffe8cc | Row color hex. |
is_activepost | int | 1 | Active flag (0/1). |
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\/Ticket.AutomationAdd",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"title": "Follow up unassigned",
"after_minutes": "15",
"condition_type": "not_assigned",
"action_send_email": "1",
"email_to_customer": "1",
"email_template_id": "42"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Ticket.AutomationAdd",
"url_domain": "https:\/\/{domain}\/app\/Ticket.AutomationAdd"
}Endpoint
POST /app/Ticket.AutomationAdd
POST https://{user}.bull36.com/app/Ticket.AutomationAdd
POST https://{domain}/app/Ticket.AutomationAddSample Output
{
"success": 1,
"message": "Success",
"id": 3
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({ title: 'Follow up unassigned', after_minutes: '15', condition_type: 'not_assigned', action_send_email: '1', email_to_customer: '1', email_template_id: '42' });
const res = await fetch('/app/Ticket.AutomationAdd', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());Error Example
{
"success": 0,
"message": "Permission denied to manage ticket automation"
}