Create Rule
create_rule_templateCreate a rule configuration on this connection: a deduplication scheme (which fields identify a duplicate, which record survives, which value wins per field), a normalize scheme, a segment definition, or an enrichment field mapping. tool_type, object_type and kind are FIXED AT CREATE and cannot be changed afterwards -- authoring a different kind means authoring a new template. config is validated against that kind's own validator, so a rule the engine could not execute is refused here rather than at dispatch. READ THE SHAPE FIRST: call get_default_rule_config for the shipped default of this tool/object/kind, or get_rule_template on an existing one. A SEGMENT has no shipped default, so its shape is here: {"name": <the Segment's name>, "membership_mode": "first_match", "default_value": null, "segments": [{"name": , "order": , "predicate": {"kind": "group", "combinator": "AND", "nodes": [{"kind": "condition", "field": , "operator": "gte", "value": 50}]}}]}; object_type is "any". The name must be unique for the tool, object and kind. This creates configuration, not work: no run is created and nothing is written to the CRM. A connection's verification rules are not created here: every connection is seeded one set, and it is changed with update_rule_template.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Which slice of the tool's configuration this is. Deduplication needs one of each: matching, master_record, survivorship. A segment is always 'segments' and may omit it. Omit for normalize and enrichment, which have no kinds. | |
| name | Yes | A name for the rule, unique within this tool, object and kind. | |
| config | Yes | The rule itself. Its shape depends on tool_type and kind -- call get_default_rule_config or get_rule_template to see it before writing one. | |
| tool_type | Yes | Which tool this rule configures. | |
| object_type | Yes | Which CRM object the rule applies to: contact, account or lead. | |
| connection_id | Yes | The CRM connection. Call list_crm_connections first. |