post https://{subdomain}.kommo.com/api/v4//custom_fields
This method allows to add singular or multiple custom fields to an entity(leads, companies, contacts)
Limitations
The method is available for administrator users only.
Data type header when the request is successful
Content-Type: application/hal+json
Data type header in case of an error
Content-Type: application/problem+json
Request parameters
To add a custom field, a field object should be passed.
Parameter | Data type | Description | Is the field mandatory | Supported field types |
---|---|---|---|---|
type | string | Field type | ✅ | Available for all field types |
name | string | Field name | ✅ | Available for all field types |
code | string | Field code that can be used to update the value of the field without passing the field ID in the request | ❌ | Available for all field types |
sort | int | Field sorting in the field group | ❌ | Available for all field types |
group_id | string | Field group ID | ❌ | Available for all lead, contact, company fields |
is_api_only | bool | Defines whether the field is editable via API only | ❌ | Available for all lead, contact, and company fields |
required_statuses | array|null | Array of the fields required to change a lead status | ❌ | Available for all lead, contact, and company fields |
required_statuses[0] | object | Required field model | ❌ | Available for all lead, contact, and company fields |
required_statuses[0][status_id] | int | ID of the stage which requires the current field to have a value before the lead can be moved | ❌ | Available for all lead, contact, and company fields |
required_statuses[0][pipeline_id] | int | ID of the pipeline which requires the current field to have a value before the lead can be moved | ❌ | Available for all lead, contact, and company fields |
remind | string|null | Birthday reminders setting (never, day – day before the event, week – week before the event, month – month before the event) | ❌ | Available only for the birthday type fields |
enums | array | Available field values array | ✅ | Available for the following field types: -multiselect -radiobutton -select |
enums[0] | object | Available field value model | ✅ | Available for the following field types: -multiselect -radiobutton -select |
enums[0][value] | string | Value | ✅ | Available for the following field types: -multiselect -radiobutton -select |
enums[0][sort] | string | Value sorting | ✅ | Available for the following field types: -multiselect -radiobutton -select |