POST

Fields.Add

Add a customer field setting. Same storage as dashboard Settings → Custom fields (user_detail.extra_fields + extra_fields_order). For custom fields this creates a definition with name like a-{unix}. For fixed/regular fields this only updates folderadd-form settings.

Permissions

  • 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.
  • Only the organization owner or a manager can add customer fields or field settings.

Action

  • Creates a Fields record or sends the requested data after validation.

Push Service

Pushes event fields.add.created to users who should see this change.

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.
  • Matches CRM Setting.php create: name=a-{timestamp}, keys en/he/type/name/position/require/show_hide/encrypted_data/dependency.
  • After create, call User.Basic and use data.field_settings.customer.extra_fields — use field.name (a-...) in Customer.Update extra_fields, not only the label.

Required Parameters

NameTypeSampleExplanation
label
post
stringBudgetDisplay label for a custom field. You may send label_en/en and label_he/he separately. For fixed fields send field_key instead.

Optional Parameters

NameTypeSampleWhat it gives
field_kind
post
stringcustomcustom creates a custom customer field. fixed, regular, or common changes settings for an existing fixed customer field. Defaults to custom. Do not put input type here.
field_key
post
stringphoneFixed/regular customer field key such as name, phone, mobile, email, company, source, notes, address, city, folder_id, status_id, tag, or extra_fields.
field_name
post
stringa-1710000000Custom field storage key. If omitted, server creates a-{unix} like the CRM.
type
post
stringnumberCustom input type (CRM): text, textarea, number, date, datetime, time, hour, year, select, radio, radio_custom, checkbox, file, image, button, title, group, email, phone, tel, url, formula.
position
post
int3Order of the field in the custom/folder field list.
required
post
int1Set 1 when the UI should require this field. Alias: require.
show_hide
post
int1Set 1 visible, 0 hidden. Alias: visible.
encrypted_data
post
int0Set 1 when values for this custom field should be treated as encrypted/sensitive.
options
post
json/list["Small","Medium","Large"]Options for select/radio/checkbox fields. options_en and options_he are also accepted.
options_en
post
stringUSA,CanadaComma-separated English options for select/radio/checkbox.
options_he
post
stringUSA,CanadaComma-separated Hebrew options for select/radio/checkbox.
coloroption
post
string#2f80ed,#27ae60Comma-separated option colors matching options_en/options_he.
multiple
post
int0Set 1 to allow multi-select on select fields.
dependency
post
int1Set 1 when this field should show only when another field has a value.
dependency_field
post
stringa-1710000000Parent custom field name this field depends on. Alias: dependency_field_name.
dependency_field_value
post
stringUSAParent option value that must be selected for this field to show.
folder_id
post
int1For fixed/regular fields, add the field to this folder field list.
dashboard_slot
post
int2Place the field in organization dashboard slot field_1, field_2, etc.
dashboard_fields
post
json["name","phone"]For folder-specific dashboard fields, send folder_id and the full ordered list.
pinned_field_on_dashboard
post
json["phone"]For folder-specific pinned dashboard fields, send folder_id and the full pinned list.

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\/Fields.Add",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "field_kind": "custom",
        "label": "Budget",
        "type": "number",
        "required": "0",
        "show_hide": "1"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Fields.Add",
    "url_domain": "https:\/\/{domain}\/app\/Fields.Add"
}

Endpoint

POST /app/Fields.Add
POST https://{user}.bull36.com/app/Fields.Add
POST https://{domain}/app/Fields.Add

Sample Output

{
    "success": 1,
    "message": "Field created",
    "field_kind": "custom",
    "field_name": "a-1710000000",
    "data": {
        "en": "Budget",
        "he": "Budget",
        "type": "number",
        "name": "a-1710000000",
        "position": "",
        "require": "0",
        "show_hide": "1",
        "encrypted_data": 0,
        "dependency": 0
    },
    "socket_event": "fields.add.created",
    "automation_event": null
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams({ field_kind: 'custom', label: 'Budget', type: 'number', required: '0', show_hide: '1' });
const res = await fetch('/app/Fields.Add', { method: 'POST', headers: { Authorization: `Bearer ${token}` }, body });
const data = await res.json();
console.log(data);

Error Example

{
    "success": "0",
    "error": "missing_required_parameter",
    "message": "Missing required parameter: label"
}