POST
Fields.Add
Add a customer field setting. For custom fields, this creates a new custom customer field definition in User.Basic field_settings.customer.extra_fields. For fixed/regular fields, this adds an existing fixed field to folderadd-form settings; fixed database fields themselves are not created.
Permissions
- 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
- Send the bearer token on protected calls with Authorization: Bearer YOUR TOKEN.
- Send parameters as POST body fields exactly as documented.
- Send date/time values in UTC Y-m-d H:i:s format when a date or datetime field is used.
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. |
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 for custom fields the server creates one. |
typepost | string | number | Custom input type: text, textarea, number, date, datetime, time, select, radio, checkbox, file, image, button, title, group, email, phone, url, or 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. |
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.
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",
"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"
}