Skip to main content
POST
Create a custom field rule

Authorizations

Authorization
string
header
required

API key authentication. Use "Bearer <api_key>" or "Api-Key <api_key>".

Body

application/json
label
string
required

Rule label

Required string length: 1 - 255
source_custom_field_uuid
string
required

Source custom field UUID. Lead and partner rules read only fields of their own entity_type with the target field's partner type. Deal (lead_deal) rules may also read the deal's lead fields and its partner's fields, as the source and as conditions, when the field's partner type matches the target's (distributor partner fields count as reseller).

action_type
enum<string>
required

Rule action: set_value, show_field, or value_mapping

Available options:
set_value,
show_field,
value_mapping
target_custom_field_uuid
string
required

Target custom field UUID. Must be a field of the rule's entity_type.

entity_type
enum<string>
required

Entity type this rule applies to

Available options:
partner,
lead,
lead_deal
source_values
(string | number | boolean | object)[]

Values that trigger the rule; {operator, value} objects are numeric threshold conditions for number source fields

Maximum array length: 100
target_value
object · null · null

Value to set when action_type is set_value

value_mappings
object[] | null

Value mapping pairs for value_mapping rules

Maximum array length: 100
locked
boolean

Whether the target field is locked when the rule matches

conditions
object[]

Extra conditions, each on its own custom field, evaluated alongside the primary condition (source_custom_field_uuid + source_values). For show_field and set_value, the primary condition and every extra condition are combined with condition_operator. For value_mapping, the extra conditions form a gate: they are combined among themselves with condition_operator, and the first matching value_mappings row on the source field applies only while the gate passes. A condition matches when the field's value matches any of its values. Each condition field must be a distinct field, different from the source and target fields, that the rule may read (see source_custom_field_uuid). At most 20 conditions.

Maximum array length: 20
condition_operator
enum<string>

How conditions combine: and (all must match) or or (any may match). For show_field and set_value it combines the primary condition with the extra conditions; for value_mapping it combines only the extra conditions (the gate). Defaults to and.

Available options:
and,
or

Response

201 - application/json

Default Response

uuid
string
required
label
string
required
active
boolean
required
source_custom_field_uuid
string
required
source_values
(string | number | boolean | object)[]
required
action_type
enum<string>
required
Available options:
set_value,
show_field,
value_mapping
target_custom_field_uuid
string
required
target_value
object · null · null
required
value_mappings
object[] | null
required
conditions
object[]
required

Extra conditions, each on its own custom field, evaluated alongside the primary condition (source_custom_field_uuid + source_values). For show_field and set_value, the primary condition and every extra condition are combined with condition_operator. For value_mapping, the extra conditions form a gate: they are combined among themselves with condition_operator, and the first matching value_mappings row on the source field applies only while the gate passes. A condition matches when the field's value matches any of its values. Each condition field must be a distinct field, different from the source and target fields, that the rule may read (see source_custom_field_uuid). At most 20 conditions.

condition_operator
enum<string>
required

How conditions combine: and (all must match) or or (any may match). For show_field and set_value it combines the primary condition with the extra conditions; for value_mapping it combines only the extra conditions (the gate).

Available options:
and,
or
locked
boolean
required
entity_type
enum<string>
required
Available options:
partner,
lead,
lead_deal
created_at
string
required
updated_at
string
required