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
| Name | Type | Sample | Explanation |
|---|---|---|---|
labelpost | string | Budget | Display 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
| Name | Type | Sample | What it gives |
|---|---|---|---|
field_kindpost | string | custom | custom 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_keypost | string | phone | Fixed/regular customer field key such as name, phone, mobile, email, company, source, notes, address, city, folder_id, status_id, tag, or extra_fields. |
field_namepost | string | a-1710000000 | Custom field storage key. If omitted, server creates a-{unix} like the CRM. |
typepost | string | number | Custom 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. |
positionpost | int | 3 | Order of the field in the custom/folder field list. |
requiredpost | int | 1 | Set 1 when the UI should require this field. Alias: require. |
show_hidepost | int | 1 | Set 1 visible, 0 hidden. Alias: visible. |
encrypted_datapost | int | 0 | Set 1 when values for this custom field should be treated as encrypted/sensitive. |
optionspost | json/list | ["Small","Medium","Large"] | Options for select/radio/checkbox fields. options_en and options_he are also accepted. |
options_enpost | string | USA,Canada | Comma-separated English options for select/radio/checkbox. |
options_hepost | string | USA,Canada | Comma-separated Hebrew options for select/radio/checkbox. |
coloroptionpost | string | #2f80ed,#27ae60 | Comma-separated option colors matching options_en/options_he. |
multiplepost | int | 0 | Set 1 to allow multi-select on select fields. |
dependencypost | int | 1 | Set 1 when this field should show only when another field has a value. |
dependency_fieldpost | string | a-1710000000 | Parent custom field name this field depends on. Alias: dependency_field_name. |
dependency_field_valuepost | string | USA | Parent option value that must be selected for this field to show. |
folder_idpost | int | 1 | For fixed/regular fields, add the field to this folder field list. |
dashboard_slotpost | int | 2 | Place the field in organization dashboard slot field_1, field_2, etc. |
dashboard_fieldspost | json | ["name","phone"] | For folder-specific dashboard fields, send folder_id and the full ordered list. |
pinned_field_on_dashboardpost | 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.AddSample 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"
}