POST

CustomerStatuses.Edit

Edit a Customer Status using the same fields as the dashboard. Custom row = custom_customer_status_form (old_name, name, status_color). Default row = settings_cust_table_status_form (cust_dynamic_name_id, name_for, cust_name_en, cust_name_he, status_color).

Permissions

  • User must be logged in with a valid bearer token.
  • Returned or changed records are limited by the user permissions, team access, folder access, and account settings.

Action

  • Updates the requested CustomerStatuses record after validating permissions and input fields.

Push Service

Pushes event customerstatuses.edit.updated to users who should see this change.

Automation

No automation is run for this function.

Special Instructions

  • Custom status (has delete icon): send old_name, name, status_color. Same as dashboard custom_customer_status_form.
  • Default status (no delete icon): send cust_dynamic_name_id, name_for, cust_name_en, cust_name_he, status_color. Same as dashboard settings_cust_table_status_form.
  • name_for keys for defaults: new, active, in work, No Answer, Answer.

Required Parameters

No body parameters are required for this function.

Optional Parameters

NameTypeSampleWhat it gives
old_name
post
stringddddd123Custom edit: current status name. Required for custom statuses.
name
post
stringddddd123Custom edit: new status name. Required with old_name.
cust_dynamic_name_id
post
int1118Default edit: cust_dynamic_name id. Send 0 when the default status has not been saved yet.
name_for
post
stringNo AnswerDefault edit: system key (new, active, in work, No Answer, Answer).
cust_name_en
post
stringNo Answer 1Default edit: English label.
cust_name_he
post
stringאין תשובהDefault edit: Hebrew label.
status_color
post
string#e33737Color for both custom and default edit.

Authentication

Send the bearer token returned by Login in the request header.

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/CustomerStatuses.Edit",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "cust_dynamic_name_id": "1118",
        "name_for": "No Answer",
        "cust_name_en": "No Answer 1",
        "cust_name_he": "אין תשובה",
        "status_color": "#e33737"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/CustomerStatuses.Edit",
    "url_domain": "https:\/\/{domain}\/app\/CustomerStatuses.Edit"
}

Endpoint

POST /app/CustomerStatuses.Edit
POST https://{user}.bull36.com/app/CustomerStatuses.Edit
POST https://{domain}/app/CustomerStatuses.Edit

Sample Output

{
    "success": 1,
    "message": "Success",
    "id": "1118",
    "name_for": "No Answer",
    "socket_event": "customerstatuses.edit.updated"
}

JavaScript Example

const token = 'YOUR TOKEN';
// Default status (settings_cust_table_status_form)
const defaultBody = new URLSearchParams({
  cust_dynamic_name_id: '1118',
  name_for: 'No Answer',
  cust_name_en: 'No Answer 1',
  cust_name_he: 'אין תשובה',
  status_color: '#e33737'
});
await fetch('/app/CustomerStatuses.Edit', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body: defaultBody });

// Custom status (custom_customer_status_form)
const customBody = new URLSearchParams({ old_name: 'ddddd123', name: 'ddddd123', status_color: '#000000' });
await fetch('/app/CustomerStatuses.Edit', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body: customBody });

Error Example

{
    "success": 0,
    "message": "Missing required parameter: old_name or name_for"
}